Skip to main content

GeoPakTile

For writing geopackage XYZ raster tile layers, with support for using arbitrary grid systems.

Geopackage XYZ files can use any tile grid system, this is often defined by a server's GetCapabilities response where a TileMatrixSet defines the data co-ordinate system, the extent, the number of rows and columns in each zoom lever, and the corner co-ordinates for each zoom level. This package contains a tool for parsing the GetCapabilities XML into a morecantile TileMatrixSet, and then for writing tiles to a new or existing geopackage.

Examples

Write tiles to a new geopackage using web mercator (similar to mbtiles), where tiles is a list of (z, x, y, bytes). tms is a morecantile TileMatrixSet - the standard web mercator can be obtained with morecantile.tms.get('WebMercatorQuad')

# Here, a list of tiles are read from a local path, the bytes and co-ordinates are stored as tuples in a list:
# You might get these tiles from a tile server or anywhere else. Adjust accordingly.

tiles = [
    (z, x, y, path.read_bytes()),
    (z2, x2, y2, path2.read_bytes()),
    (z3, x3, y3, path3.read_bytes()),
    ...
]

with GeoPakTile(test_gpkg, tms=morecantile.tms.get('WebMercatorQuad'), mode='rwc') as gpkg:
    gpkg.add_tiles(tiles)

Parse a GetCapabilties xml to provide the TileMatrixSet for writing a geopackage:

tms_set = parse_capabilities(xml)
tms = tms_set[0] # you'll need to know which one you want, or use:

tms = get_tile_matrix_set(xml, identifier = '1km') # an identifier that you know is defined in the xml

TileMatrixSet models

Tile Matrix definitions use the morecantile package (morecantile.TileMatrixSet, TileMatrix, etc.) so any morecantile TileMatrixSet (built-in or custom-loaded) can be passed to GeoPakTile. The XML parser returns morecantile TileMatrixSet objects.

XML Parser

The xml parser has been tested on NASA GetCapabilties XML and some others, if you come across any that doesn't work then please raise an issue or fix and pull request.

Metadata

Release files for GeoPakTile 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for GeoPakTile 2.0.0
File Size Uploaded Provenance Actions
geopaktile-2.0.0.tar.gz 9.1 kB Without provenance Details for geopaktile-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for GeoPakTile 2.0.0
File Interpreter ABI Platform Actions
geopaktile-2.0.0-py3-none-any.whl Python 3 none any Details for geopaktile-2.0.0-py3-none-any.whl

Total release size: 20.1 kB

Release files / geopaktile-2.0.0.tar.gz

Download URL geopaktile-2.0.0.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3fc1e4b91718c13fcfa6b3a6a8ab4a24a2fbb4db06ab021b561e6b14ff56587f
BLAKE2b-256 checksum
How to use checksums
1e43def5159dcde42dee061772289540aef475f3e1efbdc4b41b97cb42e5e80b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / geopaktile-2.0.0-py3-none-any.whl

Download URL geopaktile-2.0.0-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
97e8b00a72afde219ea7bc4bb6045d0aed49a87c29f993e5fd2d816ed89c2a11
BLAKE2b-256 checksum
How to use checksums
c6989b9088b2c88aa39b5eceb0f4d258bbb8a04f380d44e47ba7452a0f723974
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for GeoPakTile 2.0.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.

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