Skip to content

aiopmtiles

Async Version of Python PMTiles Reader.

Test Coverage Package version Downloads Downloads


Documentation: developmentseed.org/aiopmtiles/

Source Code: developmentseed/aiopmtiles


aiopmtiles is a python Async I/O version of the great PMTiles python reader.

The PMTiles format is a Cloud-optimized + compressed single-file tile archives for vector and raster maps.

Installation

$ python -m pip install pip -U

# From Pypi
$ python -m pip install aiopmtiles

# Or from source
$ python -m pip install git+http://github.com/developmentseed/aiopmtiles

Example

from aiopmtiles import Reader

async with Reader("https://r2-public.protomaps.com/protomaps-sample-datasets/cb_2018_us_zcta510_500k.pmtiles") as src:
    # PMTiles Metadata
    meta = src.metadata

    # Spatial Metadata
    bounds = src.bounds
    minzoom, maxzoom = src.minzoom, src.maxzoom

    # Is the data a Vector Tile Archive
    assert src.is_vector

    # PMTiles tiles type
    tile_type = src._header["tile_type"]

    # Tile Compression
    comp = src.tile_compression

    # Get Tile
    data = await src.get_tile(0, 0, 0)

Contribution & Development

See CONTRIBUTING.md

Authors

See contributors

Changes

See CHANGES.md.

License

See LICENSE