Extracting Tiles from PMTiles

There are a couple ways to extract map tiles from the various archives - the most popular being MBTiles and PMTiles these days. The best way, though, is using tile-join from felt/tippecanoe:

tile-join -e dir/ input.pmtiles

This will output all tiles as a hierarchy in dir - dir/{z}/{x}/{y}.{ext}. When working with vector tiles, you might need to specify -pC (no tile compression). By default, tiles are compressed in the archive, but if you need the raw tiles in a directory, specifying this option will output the raw, uncompressed files.

Similarly, you can use this to convert between MBTiles and PMTiles archives:

tile-join -o output.mbtiles input.pmtiles

or the reverse, MBTiles to PMTiles. However, I strongly recommend using the official Protomaps CLI pmtiles tool for this.

tile-join is a powerful tool. It was originally created for joining tilesets together, so using it to convert and extract tiles is a bit counter-intuitive, but it’s the best solution today.