2022-10-07 11:40:54 +08:00
2022-07-28 12:18:13 +08:00
2022-10-05 22:34:50 +08:00
2022-07-21 20:15:10 +08:00
2022-10-07 11:40:54 +08:00
2021-04-15 10:56:58 +08:00
2021-02-16 16:36:33 +08:00

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.14.1-rc.2 or later

See also:

How To Use

JavaScript

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

Go

See https://github.com/protomaps/go-pmtiles

Python

pip install pmtiles
pmtiles-convert TILES.mbtiles TILES.pmtiles
pmtiles-convert TILES.pmtiles DIRECTORY
pmtiles-show TILES.pmtiles // see info about a PMTiles directory
pmtiles-serve TILES.pmtiles // start an HTTP server that decodes PMTiles into traditional Z/X/Y paths

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

Serverless

PMTiles on AWS Lambda

PMTiles on Cloudflare Workers

Specification

Recipes

Example of how to create a PMTiles archive from the Census Bureau Zip Code Tabulation Areas Shapefile using tippecanoe and the pmtiles-convert python program:

    # 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 --no-tile-compression --no-feature-limit --no-tile-size-limit -o cb_2018_us_zcta510_500k_nolimit.mbtiles -l zcta cb_2018_us_zcta510_500k.json
    pmtiles-convert cb_2018_us_zcta510_500k_nolimit.mbtiles cb_2018_us_zcta510_500k_nolimit.pmtiles

For uploading your PMTiles to cloud storage, rclone is recommended:

rclone config
rclone copy my_archive.pmtiles my_destination:my_folder --progress --s3-chunk-size=256M

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%