Expand description
§utiles-core ~ web map util(e)ities
Core web-map/spherical-mercator/slippy-map/xyz-tiles utilities library.
Re-exports§
pub use bbox::geobbox_merge;
pub use bbox::BBox;
pub use lnglat::wrap_lon;
pub use lnglat::LngLat;
pub use point::Point2d;
pub use point::Point3d;
pub use tile_zbox::TileZBox;
pub use zoom::*;
Modules§
- bbox
- Bounding-boxes!
- constants
- Constants module
- fns
- Core util(e)ity functions for working with web mercator tiles, bounding boxes, et al
- gdal
- GDAL related functions/utils
- geostats
- Geostats structs/models/objs
- lnglat
- Longitude and Latitude coordinates
- parsing
- Parsing util(e)ities
- pmtiles
- pmtiles util(e)s ~ aka protomap-tiles
- point
- 2d/3d points
- prelude
- projection
- Coordinate projection
- quadkey
- Quadkey conversion util(e)ities.
- sibling_
relationship - Child index as related to its parent/sibling-tiles
- tile
- XYZ-Tile core struct and methods
- tile_
data_ row - Tile + blob data container
- tile_
type - tile-type module
- tile_
zbox TileZBox
- zoom-x-y bounding box- zoom
- Zoom levels, zoom-collections and ranges oh my!
Macros§
- point2d
- point2d macro to create a new point. Replacement for coord! macro from geo-types
- utile
- Tile macro to create a new tile.
- utile_
yup
Structs§
- Tile
- Tile X-Y-Z struct
- Tile
String Format - Tile
String Formatter
Enums§
- Utiles
Core Error - Error type for utiles-core
Constants§
Traits§
- Coord2d
Like Coord2d
like trait for 2D coordinates has x/y getters- IsOk
IsOk
trait for checking if a value is Ok and returns a result of self or an error- LngLat
Like LngLat
like trait- Tile
Children1 - Tile
Like - Trait def for tile-like objects/structs/things/whatevers
- Tile
Parent
Functions§
- _xy
- Convert lng lat to web mercator x and y
- as_
zooms - Return zooms-vec from a
ZoomOrZooms
enum - bbox2zoom
- Calculate the zoom level for the bounding-tile of a bbox
- bbox_
truncate - Truncate a bounding box to the valid range of longitude and latitude.
- bounding_
tile - Return the bounding tile for a bounding box.
- bounds
- Return the bbox tuple given x, y, z.
- children
- Return the children of a tile given x, y, z, and zoom; returns children
in stupid
a, b, d, c
orderl; but this is the mercantile way… and I am not gonna fix it right now - children1_
zorder - Return the 4 direct children of a tile
- children_
zorder - Return the children of a tile given x, y, z, and zoom in z-order.
- flipy
- Return the inverted/y-flipped y coordinate for a given y and z
- from_id
- Convert tile u64 id to tile xyz
- geotransform2optzoom
- Compute the optimal zoom level for a geo-transform.
- int_
2_ offset_ zoom - Return cumulative base-tile-id for a tile and the zoom level of the tile
- ll
- Return lower left lnglat as
LngLat
from x,y,z - lnglat
- Convert web mercator x and y to longitude and latitude with optional truncation.
- lnglat2tile_
frac - Converts longitude, latitude, and zoom level to fractional tile coordinates.
- lnglat2webmercator
- Convert lng lat to web mercator x and y
- lr
- Return lower right lnglat as
LngLat
from x,y,z - merge
- Merge a set of tiles into a simplified set of tiles
- minmax
- Return tuple (min, max) x/y for a zoom-level
- neighbors
- Return neighbors of a tile (non-wrapping).
- parent
- Return the parent tile of a tile given x, y, z, and n (number of ancestors).
- parse_
textiles - quadkey2tile
- Return Tile struct from quadkey string
- quadkey2xyz
- Return (x, y, z) for a quadkey as a tuple.
- quadkey_
flipy - Return y-flipped quadkey
- rmid2xyz
- Calculate the xyz of the tile from a row-major-id
- siblings
- Return the siblings of a tile given x, y, z
- simplify
- simplify_
v1 - Tiles at or below the
minzoom
level will not be merged into their parents. Simplify a set of tiles merging children into parents - tile
- Return Tile struct from longitude, latitude, and zoom.
- tile_
ranges - Return
TileRanges
from a bounding box and zoom(s). - tiles
- Return an iterator of tiles for a bounding box and zoom(s).
- tiles_
count - Return the number of tiles for a bounding box and zoom(s).
- to_id
- Convert tile xyz to u64 tile id (based on mapbox coverage implementation)
- truncate_
lat - Truncate a latitude to the valid range of -90 to 90.
- truncate_
lng - Truncate a longitude to the valid range of -180 to 180.
- truncate_
lnglat - Truncate a
LngLat
to valid range of longitude and latitude. - ul
- Return upper left lnglat as
LngLat
from x,y,z - ult
- Return upper left lnglat as tuple
(f64, f64)
from x,y,z - ur
- Return upper right lnglat as
LngLat
from x,y,z - valid
- Return true if x, y, z is a valid tile coordinate
- web_
geo_ bounds_ union - Computes a “union” bounds/bbox that contains/encloses input bounds/bboxes.
The resulting bbox can cross the antimeridian (i.e.
west > east
). - webmercator2lnglat
- Convert web mercator x and y to longitude and latitude.
- xy
- Convert longitude and latitude to web mercator x and y with optional truncation.
- xyz2bbox
- Return web-mercator bbox from x, y, z.
- xyz2quadkey
- Return the quadkey for a tile as a string.
- xyz2quadkey_
vec - Return the quadkey for a tile as a vector of u8 values (0, 1, 2, 3).
- xyz2rmid
- Calculate the row-major-id for a tile which is the index of the tile for the zoom level PLUS the total number of tiles in all zoom levels below it for the zoom level.
- yflip
- Return the y-flipped y coordinate for a given y and z
Type Aliases§
- Utiles
Core Result - Result type for utiles-core; really a type alias for
Result<T, UtilesCoreError>