protomaps / PMTiles

Cloud-optimized + compressed single-file tile archives for vector and raster maps
https://protomaps.com/docs/pmtiles/
BSD 3-Clause "New" or "Revised" License
2.07k stars 121 forks source link

support for conversion back to mbtiles (or pmtile-join) #78

Closed underbluewaters closed 2 years ago

underbluewaters commented 2 years ago

If maintaining a library of layers converted to pmtiles, it would be nice to be able to consolidate them into a multi-layer tileset. Right now the conversion to pmtiles seems to be a one-way process. If the archive could be converted back to mbtiles then tippecanoe's tile-join utility could be used. I can't get my head around whether an analogous pmtiles-join process would be possible.

bdon commented 2 years ago

Agreed, this should be pretty simple to implement and should happen in http://github.com/protomaps/go-pmtiles

Thinking out loud a bit, the MBTiles spec only specifies a view over the tiles table - a dataset originally created in PMTiles format would write two tables, one tile_data and another tile_coords with a JOIN in between using a synthetic key or even the offset in the PMTiles archive as an integer join key.

In the long run I would hope for a pmtiles-join command but we do need the conversion back for interior with existing tools.