Tilematrix
Tilematrix handles geographic web tiles and tile pyramids.
The module is designed to translate between tile indices (zoom, row, column = ZYX) and map coordinates (e.g. latitute, longitude).
Tilematrix supports metatiling and tile buffers. Furthermore it makes heavy use of shapely and it can also generate Affine objects per tile which facilitates working with rasterio for tile based data reading and writing.
It is very similar to mercantile but besides of supporting spherical mercator tile pyramids, it also supports geodetic (WGS84) tile pyramids.
Installation
Use conda to install the latest stable version:
conda install -c conda-forge -y tilematrix
Use pip to install the latest stable version:
pip install tilematrix
Manually install the latest development version
pip install -r requirements.txt
python setup.py install
Documentation
CLI
This package ships with a command line tool tmx which provides the following subcommands:
bounds: Print bounds of given Tile.
bbox: Print bounding box geometry of given Tile.
tile: Print Tile covering given point.
tiles: Print Tiles covering given bounds.
Geometry outputs can either be formatted as WKT or GeoJSON. For example the following command will print a valid GeoJSON representing all tiles for zoom level 1 of the geodetic WMTS grid:
$ tmx -f GeoJSON tiles -- 1 -180 -90 180 90
{
"type": "FeatureCollection",
"features": [
{"geometry": {"coordinates": [[[-90.0, 0.0], [-90.0, 90.0], [-180.0, 90.0], [-180.0, 0.0], [-90.0, 0.0]]], "type": "Polygon"}, "properties": {"col": 0, "row": 0, "zoom": 1}, "type": "Feature"},
{"geometry": {"coordinates": [[[0.0, 0.0], [0.0, 90.0], [-90.0, 90.0], [-90.0, 0.0], [0.0, 0.0]]], "type": "Polygon"}, "properties": {"col": 1, "row": 0, "zoom": 1}, "type": "Feature"},
{"geometry": {"coordinates": [[[90.0, 0.0], [90.0, 90.0], [0.0, 90.0], [0.0, 0.0], [90.0, 0.0]]], "type": "Polygon"}, "properties": {"col": 2, "row": 0, "zoom": 1}, "type": "Feature"},
{"geometry": {"coordinates": [[[180.0, 0.0], [180.0, 90.0], [90.0, 90.0], [90.0, 0.0], [180.0, 0.0]]], "type": "Polygon"}, "properties": {"col": 3, "row": 0, "zoom": 1}, "type": "Feature"},
{"geometry": {"coordinates": [[[-90.0, -90.0], [-90.0, 0.0], [-180.0, 0.0], [-180.0, -90.0], [-90.0, -90.0]]], "type": "Polygon"}, "properties": {"col": 0, "row": 1, "zoom": 1}, "type": "Feature"},
{"geometry": {"coordinates": [[[0.0, -90.0], [0.0, 0.0], [-90.0, 0.0], [-90.0, -90.0], [0.0, -90.0]]], "type": "Polygon"}, "properties": {"col": 1, "row": 1, "zoom": 1}, "type": "Feature"},
{"geometry": {"coordinates": [[[90.0, -90.0], [90.0, 0.0], [0.0, 0.0], [0.0, -90.0], [90.0, -90.0]]], "type": "Polygon"}, "properties": {"col": 2, "row": 1, "zoom": 1}, "type": "Feature"},
{"geometry": {"coordinates": [[[180.0, -90.0], [180.0, 0.0], [90.0, 0.0], [90.0, -90.0], [180.0, -90.0]]], "type": "Polygon"}, "properties": {"col": 3, "row": 1, "zoom": 1}, "type": "Feature"}
]
}
Print WKT representation of tile 4 15 23:
$ tmx bbox 4 15 23
POLYGON ((90 -90, 90 -78.75, 78.75 -78.75, 78.75 -90, 90 -90))
Also, tiles can have buffers around called pixelbuffer:
$ tmx --pixelbuffer 10 bbox 4 15 23
POLYGON ((90.439453125 -90, 90.439453125 -78.310546875, 78.310546875 -78.310546875, 78.310546875 -90, 90.439453125 -90))
Print GeoJSON representation of tile 4 15 23 on a mercator tile pyramid:
$ tmx -output_format GeoJSON -grid mercator bbox 4 15 15
{"type": "Polygon", "coordinates": [[[20037508.342789203, -20037508.3427892], [20037508.342789203, -17532819.799940553], [17532819.799940553, -17532819.799940553], [17532819.799940553, -20037508.3427892], [20037508.342789203, -20037508.3427892]]]}
Conda Publishing
Use bot pull requests generated with every release at tilematrix-feedstock repository for releasing new versions on conda-forge.
License
MIT License
Copyright (c) 2015-2022 EOX IT Services
Metadata
Release files for tilematrix 2024.11.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tilematrix-2024.11.0.tar.gz | 12.8 kB | Without provenance | Details for tilematrix-2024.11.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tilematrix-2024.11.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for tilematrix-2024.11.0-py2.py3-none-any.whl |
Total release size: 29.0 kB
Release files / tilematrix-2024.11.0.tar.gz
| Download URL | tilematrix-2024.11.0.tar.gz |
|---|---|
| Size | 12.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa86980d9187a931b5420d90cd03cb8d975a041e95c621bed7bbe9c7c2ec2b87
|
|
BLAKE2b-256 checksum How to use checksums |
47bac43afad82ead2bf1532968728b1ae0f5a830fde516bad444de669d70f2e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.27.2
|
Release files / tilematrix-2024.11.0-py2.py3-none-any.whl
| Download URL | tilematrix-2024.11.0-py2.py3-none-any.whl |
|---|---|
| Size | 16.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
5e72c2a68a643f581c587ef244ea87f25d6214c2605554fc6087f0046afed8d8
|
|
BLAKE2b-256 checksum How to use checksums |
738d11919c59067c5af579ed0f5c5cc90deb19dee5c6cc838dee8b0332ed4468
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.27.2
|
Security for tilematrix 2024.11.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.