MCPcopy Create free account
hub / github.com/protomaps/PMTiles

github.com/protomaps/PMTiles @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
350 symbols 1,058 edges 44 files 27 documented · 8% 22 cross-repo links updated 11d ago★ 3,0148 open issues

Browse by type

Functions 271 Types & classes 76 Endpoints 3
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

pmtiles npm pmtiles pypi rio-pmtiles pypi ol-pmtiles npm

🔎 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: * Cloud Optimized GeoTIFFs

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 pmtiles scripts 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.

Extension points exported contracts — how you extend this code

browse all types & interfaces →

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 141
Method 130
Class 53
Interface 21
Route 3
Enum 2

Languages

TypeScript64%
Python36%

Modules by API surface

js/src/index.ts62 symbols
app/src/tileset.ts61 symbols
python/rio-pmtiles/tests/test_cli.py28 symbols
python/pmtiles/pmtiles/tile.py23 symbols
python/pmtiles/test/test_tile.py22 symbols
app/src/PageTile.tsx15 symbols
serverless/cloudflare/src/index.ts11 symbols
serverless/aws/src/index.ts10 symbols
python/pmtiles/pmtiles/reader.py10 symbols
app/src/PageMap.tsx9 symbols
app/src/Frame.tsx9 symbols
js/src/adapters.ts8 symbols

Dependencies from manifests, versioned

@alenaksu/json-viewer2.1.2 · 1×
@aws-sdk/client-s33.982.0 · 1×
@biomejs/biome1.5.3 · 1×
@cloudflare/workers-types4.20230518.0 · 1×
@mapbox/sphericalmercator2.0.1 · 1×
@mapbox/vector-tile2.0.3 · 1×
@maplibre/maplibre-gl-style-spec24.3.1 · 1×
@protomaps/basemaps5.2.0 · 1×
@smithy/node-http-handler3.1.4 · 1×
@tailwindcss/vite4.1.17 · 1×
@types/aws-lambda8.10.145 · 1×
@types/d3-axis3.0.6 · 1×

For agents

$ claude mcp add PMTiles \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page