Morecantile
Description:
- Construct and use map tile grids
Resources:
- [GitHub] https://github.com/developmentseed/morecantile
- [Docs] https://developmentseed.org/morecantile/usage/
Example 1
Section titled “Example 1”Get TMS bounding box
import morecantile
tms = morecantile.tms.get("WebMercatorQuad")print(tms.xy_bbox)Example 2
Section titled “Example 2”Get the bounds for tile Z=4, X=10, Y=10 in the TMS’s CRS (e.g epsg:3857)
import morecantile
tms = morecantile.tms.get("WebMercatorQuad")print(tms.xy_bounds(morecantile.Tile(10, 10, 4)))Example 3
Section titled “Example 3”Get the bounds for tile Z=4, X=10, Y=10 in Geographic CRS (e.g epsg:4326)
import morecantile
tms = morecantile.tms.get("WebMercatorQuad")print(tms.bounds(morecantile.Tile(10, 10, 4)))Example 4
Section titled “Example 4”Define a custom grid
import morecantilefrom pyproj import CRS
crs = CRS.from_epsg(3031)extent = [-948.75, -543592.47, 5817.41, -3333128.95] # From https:///epsg.io/3031customEPGS3031 = morecantile.TileMatrixSet.custom(extent, crs, id="MyCustomTmsEPSG3031")
print(customEPGS3031.matrix(0).dict(exclude_none=True))ganymede is made by Eugo