Struct geogrid::GeoGrid [] [src]

pub struct GeoGrid { /* fields omitted */ }

GeoGrid represents some portion of a geographic map as a grid. The grid computes step size from the center of the bounds. Because earth is not flat there will be some distance distortion farther from the central latitude if the grid is spread over a large area.

Methods

impl GeoGrid
[src]

Construct a GeoGrid from a slice of roads, where each road is a slice of nodes. This constructor will interpolate linearly between nodes within each row to set to 1. The grid's bounds will be exactly large enough to contain every given map node. Resolution is given as pair of (height, width) of the grid in pixels. If scale is true, then the aspect ratio of the original map will be maintained, potentially reducing one of the resolution dimensions. Otherwise, with scale false, the grid will stretch to the provided resolution.

Construct a GeoGrid from provided slice of nodes using given resolution, expressed in units of (meters latitude per grid unit, meters longitude per grid unit).

Grid resolution, in meters per row and meters per column.

Grid resolution, in degrees latitude per row and degrees longitude per column.

Return the lat/lon boundaries of the grid.

Grid dimensions.

Grid length, product of width and height.

Grid is 0x0.

Clears the grid, but leaves all other fields intact. Maybe useful to save memory if you only need the distance transform and not the original grid.

Latitude and longitude covered, in meters. resolution * size.

Immutable access to the underlying grid.

Mutable access to the underlying grid.

Trace provided shape from given top left index, returning locations of all the true cells.

Return lat, lon coordinates of given index in the grid.

Return closest index in grid to given latitude, longitude.

Return start index and a new size of a bounded subgrid specified by given rectangle in degrees.

Compute L1 distance transform of t matrix. Output is linearized matrix of same size as grid.

Trait Implementations

impl Clone for GeoGrid
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more