GithubHelp home page GithubHelp logo

developmentseed / morecantile Goto Github PK

View Code? Open in Web Editor NEW
107.0 9.0 25.0 1.09 MB

Construct and use OGC TileMatrixSets (TMS)

Home Page: https://developmentseed.org/morecantile/

License: MIT License

Python 100.00%

morecantile's Introduction

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.