Skip to main content

Construct and use map tile grids (a.k.a TileMatrixSet / TMS).

Project description

Morecantile

Construct and use map tile grids (a.k.a TileMatrixSet / TMS).

Test Coverage Package version Downloads License


Documentation: https://developmentseed.org/morecantile/

Source Code: https://github.com/developmentseed/morecantile


Morecantile is like mercantile (the best tool to work with Web Mercator tile indexes), but with support for other TileMatrixSet grids.

Morecantile follows the OGC Two Dimensional Tile Matrix Set specification found in http://docs.opengeospatial.org/is/17-083r2/17-083r2.html

Note: Variable matrix width tile set are not supported.

Install

$ python -m pip install -U pip
$ python -m pip install morecantile

# Or install from source:

$ python -m pip install -U pip
$ python -m pip install git+https://github.com/developmentseed/morecantile.git

Usage

import morecantile

tms = morecantile.tms.get("WebMercatorQuad")

# Get TMS bounding box
print(tms.xy_bbox)
>>> BoundingBox(
    left=-20037508.342789244,
    bottom=-20037508.34278919,
    right=20037508.34278919,
    top=20037508.342789244,
)

# Get the bounds for tile Z=4, X=10, Y=10 in the TMS's CRS (e.g epsg:3857)
print(tms.xy_bounds(morecantile.Tile(10, 10, 4)))
>>> BoundingBox(
    left=5009377.085697308,
    bottom=-7514065.628545959,
    right=7514065.628545959,
    top=-5009377.085697308,
)

# Get the bounds for tile Z=4, X=10, Y=10 in Geographic CRS (e.g epsg:4326)
print(tms.bounds(morecantile.Tile(10, 10, 4)))
>>> BoundingBox(
    left=44.999999999999964,
    bottom=-55.776573018667634,
    right=67.4999999999999,
    top=-40.97989806962009,
)

More info can be found at https://developmentseed.org/morecantile/usage/

Defaults Grids

morecantile provides a set of default TMS grids:

  • CanadianNAD83_LCC: Lambert conformal conic NAD83 for Canada - EPSG:3978
  • EuropeanETRS89_LAEAQuad: ETRS89-extended / LAEA Europe - EPGS:3035
  • LINZAntarticaMapTilegrid: LINZ Antarctic Map Tile Grid (Ross Sea Region) - EPSG:5482
  • NZTM2000: LINZ NZTM2000 Map Tile Grid - EPSG:2193
  • NZTM2000Quad: LINZ NZTM2000 Map Tile Grid - EPSG:2193
  • UPSAntarcticWGS84Quad: Universal Polar Stereographic WGS 84 Quad for Antarctic - EPSG:5042
  • UPSArcticWGS84Quad: Universal Polar Stereographic WGS 84 Quad for Arctic - EPSG:5041
  • UTM31WGS84Quad: Example of UTM grid - EPSG:32631
  • WebMercatorQuad: Spherical Mercator - EPGS:3857 (default grid for Web Mercator based maps)
  • WGS1984Quad: EPSG:4326 for the World - EPGS:4326 (WGS84)
  • WorldCRS84Quad: CRS84 for the World
  • WorldMercatorWGS84Quad: Elliptical Mercator projection - EPGS:3395

ref: http://schemas.opengis.net/tms/1.0/json/examples/

Implementations

  • rio-tiler: Create tile from raster using Morecantile TMS.
  • timvt: A lightweight PostGIS based dynamic vector tile server.
  • planetcantile: Tile matrix sets for other planets.

Changes

See CHANGES.md.

Contribution & Development

See CONTRIBUTING.md

License

See LICENSE

Authors

Created by Development Seed

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

morecantile-3.4.0.tar.gz (28.0 kB view details)

Uploaded Source

Built Distribution

morecantile-3.4.0-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

Details for the file morecantile-3.4.0.tar.gz.

File metadata

  • Download URL: morecantile-3.4.0.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.30.0

File hashes

Hashes for morecantile-3.4.0.tar.gz
Algorithm Hash digest
SHA256 9ac34dca2da5fc202cbcdaba363a38391dc92708798f6d2eb05069065753bfcc
MD5 18f34fbf430f5d49e3490bbed41b8306
BLAKE2b-256 2871452b7f0824c187cad0719b4150d702ae7fbf5545dd0f8051be33a810fa6c

See more details on using hashes here.

File details

Details for the file morecantile-3.4.0-py3-none-any.whl.

File metadata

  • Download URL: morecantile-3.4.0-py3-none-any.whl
  • Upload date:
  • Size: 33.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.30.0

File hashes

Hashes for morecantile-3.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c182df6f73a787df57e437a87ab6350fed8b6cd81262a5ddce3e7b716637866
MD5 60c42afaf9b629cdd724496f6e76f461
BLAKE2b-256 1e6264fb2b42cb01117843e0ce9bbbe87c8cfab3f45cb7150697259cc27968a4

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page