tile-grid
tile-grid is a library for using OGC TileMatrixSets (TMS).
tile-grid follows the OGC Two Dimensional Tile Matrix Set specification found in https://docs.ogc.org/is/17-083r4/17-083r4.html
Note: Variable matrix width tile set are not supported.
Usage
Load tile set matrix and get bounds of a tile
use ;
let tms = tms.lookup.unwrap;
// Get the bounds for tile Z=4, X=10, Y=10 in the input projection
let bounds = tms.xy_bounds;
assert_eq!;
// Get the bounds for tile Z=4, X=10, Y=10 in LatLon (WGS84)
let bounds = tms.bounds.unwrap;
assert_eq!;
Find tile for lat/lon
use ;
let tms = tms.lookup.unwrap;
let tile = tms.tile.unwrap;
assert_eq!;
// Or using coordinates in input CRS
let tile = tms.xy_tile;
assert_eq!;
Credits
- Morecantile by Vincent Sarago et al.
- ogcapi by Balthasar Teuscher
License
tile-grid is released under the MIT License.