Skip to main content

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 2.0 found in https://docs.ogc.org/is/17-083r4/17-083r4.html

Morecantile Version OGC Specification Version Link
>=4.0 2.0 https://docs.ogc.org/is/17-083r4/17-083r4.html
=<3.0 1.0 http://docs.opengeospatial.org/is/17-083r2/17-083r2.html

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 TileMatrixSets:

  • CDB1GlobalGrid *: CDB 1 Global Grid - EPGS:4326 (WGS84)
  • CanadianNAD83_LCC: Lambert conformal conic NAD83 for Canada - EPSG:3978
  • EuropeanETRS89_LAEAQuad: ETRS89-extended / LAEA Europe - EPGS:3035
  • GNOSISGlobalGrid *: GNOSIS Global Grid - EPGS:4326 (WGS84)
  • LINZAntarticaMapTilegrid: LINZ Antarctic Map Tile Grid (Ross Sea Region) - EPSG:5482
  • 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

* TileMatrixSets with variable Matrix Width (see https://docs.ogc.org/is/17-083r4/17-083r4.html#toc15)

ref: https://schemas.opengis.net/tms/2.0/json/examples/tilematrixset/

Implementations

  • rio-tiler: Create tile from raster using Morecantile TMS.
  • titiler: A modern dynamic tile server built on top of FastAPI and Rasterio/GDAL.
  • tipg: OGC Features and Tiles API.
  • planetcantile: Tile matrix sets for other planets.
  • supermorecado: Extend the functionality of morecantile with additional commands.

Changes

See CHANGES.md.

Contribution & Development

See CONTRIBUTING.md

License

See LICENSE

Authors

Created by Development Seed

Download files

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

Source Distribution

morecantile-7.1.0.tar.gz (43.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

morecantile-7.1.0-py3-none-any.whl (50.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: morecantile-7.1.0.tar.gz
  • Upload date:
  • Size: 43.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for morecantile-7.1.0.tar.gz
Algorithm Hash digest
SHA256 7faf41f8b3c364a322fe96d44f43b6ba55dc0ba7454222cebc3b695ffec4bc97
MD5 9bae7c1be5480625ed64942bd5a37447
BLAKE2b-256 ef4620ec1fad75ed4fc4b20c86550507f868366154040e6db1d5dd9ca6538b6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for morecantile-7.1.0.tar.gz:

Publisher: release.yml on developmentseed/morecantile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: morecantile-7.1.0-py3-none-any.whl
  • Upload date:
  • Size: 50.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for morecantile-7.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a6fd28a22467a6ec3fef1dfc4659d892a48a3c7e5e4acdceff68c6cc7956b0b
MD5 99bb6b1a1fb81c1df95f6f387a6d8796
BLAKE2b-256 a70190cb898ee87d0a5c89c60a6a95978c70bceab4180abc8855de9771df09e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for morecantile-7.1.0-py3-none-any.whl:

Publisher: release.yml on developmentseed/morecantile

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

7.1.0 This release

2 files

7.0.3

2 files

7.0.2

2 files

7.0.1

2 files

7.0.0

2 files

6.2.0

2 files

6.1.0

2 files

6.0.0

2 files

5.4.2

2 files

5.4.1

2 files

5.4.0

2 files

5.3.1

2 files

5.3.0

2 files

5.2.3

2 files

5.2.2

2 files

5.2.1

2 files

5.2.0

2 files

5.1.0

2 files

5.0.2

2 files

5.0.0

2 files

4.3.0

2 files

4.2.1

2 files

4.2.0

2 files

4.1.1

2 files

4.1.0

2 files

4.0.2

2 files

4.0.1

2 files

4.0.0

2 files

3.4.0

2 files

3.3.0

2 files

3.2.5

2 files

3.2.4

2 files

3.2.3

2 files

3.2.2

2 files

3.2.1

2 files

3.2.0

2 files

3.1.2

1 file

3.1.1

1 file

3.1.0

1 file

3.0.5

1 file

3.0.4

1 file

3.0.3

1 file

3.0.2

1 file

3.0.1

1 file

3.0.0

1 file

2.1.4

1 file

2.1.2

1 file

2.1.1

1 file

2.1.0

1 file

2.0.1

1 file

2.0.0

1 file

1.3.1

1 file

1.3.0.post1

1 file

1.3.0

1 file

1.2.0

1 file

1.1.1

1 file

1.1.0

1 file

1.0.0

1 file

0.1.0

1 file

0.0.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page