pub struct Grid {
pub extent: Extent,
pub srid: i32,
pub units: Unit,
pub origin: Origin,
/* private fields */
}
Expand description
Tile grid
Fields§
§extent: Extent
The geographical extent covered by the grid, in ground units (e.g. meters, degrees, feet, etc.). Must be specified as 4 floating point numbers ordered as minx, miny, maxx, maxy. The (minx,miny) point defines the origin of the grid, i.e. the pixel at the bottom left of the bottom-left most tile is always placed on the (minx,miny) geographical point. The (maxx,maxy) point is used to determine how many tiles there are for each zoom level.
srid: i32
Spatial reference system (PostGIS SRID).
units: Unit
Grid units
origin: Origin
Grid origin
Implementations§
Source§impl Grid
impl Grid
Sourcepub fn web_mercator() -> Grid
pub fn web_mercator() -> Grid
Web Mercator grid (Google maps compatible)
pub fn new( width: u16, height: u16, extent: Extent, srid: i32, units: Unit, resolutions: Vec<f64>, origin: Origin, ) -> Grid
pub fn nlevels(&self) -> u8
pub fn maxzoom(&self) -> u8
Sourcepub fn pixel_width(&self, zoom: u8) -> f64
pub fn pixel_width(&self, zoom: u8) -> f64
Pixel width for 256x256 tile
Sourcepub fn scale_denominator(&self, zoom: u8) -> f64
pub fn scale_denominator(&self, zoom: u8) -> f64
Scale denominator based on standardized pixel size (https://www.ogc.org/standards/se)
Sourcepub fn tile_extent(&self, xtile: u32, ytile: u32, zoom: u8) -> Extent
pub fn tile_extent(&self, xtile: u32, ytile: u32, zoom: u8) -> Extent
Extent of a given tile in the grid given its x, y, and z in TMS adressing scheme
Sourcepub fn ytile_from_xyz(&self, ytile: u32, zoom: u8) -> u32
pub fn ytile_from_xyz(&self, ytile: u32, zoom: u8) -> u32
reverse y tile for XYZ adressing scheme