Brandon Liu 63182e525d rio-pmtiles python package [#338] (#542)
Add rio-pmtiles command line tool. [#338]

This is derived from the original mapbox/rio-mbtiles implementation, with changes:

* output PMTiles only instead of MBTiles.
* Python 3.7+ only.
* remove --implementation, --image-dump, --append/--overwrite, --covers features.
* bump dependency versions.
* better progress reporting; add pyroaring. 
* update README and license texts.
* rio-pmtiles v0.0.6 on PyPI
2025-03-24 20:50:53 +08:00
2024-08-08 15:33:51 +08:00
2025-01-14 18:56:08 +08:00
2024-06-08 10:22:27 -06:00

npm pypi

🔎 PMTiles Viewer: https://pmtiles.io/ 🔎

PMTiles

PMTiles is a single-file archive format for tiled data. A PMTiles archive can be hosted on a commodity storage platform such as S3, and enables low-cost, zero-maintenance map applications that are "serverless" - free of a custom tile backend or third party provider.

Demos require MapLibre GL JS v1.15 or later.

See also:

Creating PMTiles

Download the pmtiles binary for your system at go-pmtiles/Releases.

pmtiles convert INPUT.mbtiles OUTPUT.pmtiles
pmtiles upload OUTPUT.pmtiles s3://my-bucket?region=us-west-2 // requires AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY env vars to be set

Consuming PMTiles

JavaScript

See js/README.md and js/examples for usage in Leaflet or MapLibre GL JS.

See openlayers/README.md for usage in OpenLayers.

Go

See the go-pmtiles repository.

Python

See https://github.com/protomaps/PMTiles/tree/main/python/bin for library usage

Serverless

PMTiles on AWS Lambda

PMTiles on Cloudflare Workers

Specification

The current specification version is Version 3.

Recipes

Example of how to create a PMTiles archive from the Census Bureau Zip Code Tabulation Areas Shapefile using tippecanoe:

    # use GDAL/OGR to convert SHP to GeoJSON
    ogr2ogr -t_srs EPSG:4326 cb_2018_us_zcta510_500k.json cb_2018_us_zcta510_500k.shp
    # Creates a layer in the vector tiles named "zcta"
    tippecanoe -zg --projection=EPSG:4326 -o cb_2018_us_zcta510_500k_nolimit.pmtiles -l zcta cb_2018_us_zcta510_500k.json

Uploading to Storage

Using the PMTiles command line tool:

pmtiles upload LOCAL.pmtiles "s3://BUCKET_NAME?endpoint=https://example.com&region=region" REMOTE.pmtiles

Using RClone (do rclone config first)

rclone copyto LOCAL.pmtiles r2:/BUCKET/REMOTE.pmtiles --progress --s3-chunk-size=256M --s3-upload-concurrency=2

License

The reference implementations of PMTiles are published under the BSD 3-Clause License. The PMTiles specification itself is public domain, or under a CC0 license where applicable.

Description
No description provided
Readme BSD-3-Clause 24 MiB
Languages
TypeScript 51.5%
Python 29.1%
C++ 8.8%
HTML 5.2%
C 4.1%
Other 1.3%