tippecanoe
tippecanoe copied to clipboard
Feature request: PMTiles output
It's convenient to output PMTiles directly instead of traversing MBTiles first.
The part for writing metadata is shared between dirtiles and mbtiles, is a little hairy to extend for pmtiles: https://github.com/protomaps/tippecanoe/blob/master/mbtiles.cpp#L270
Sorry, it was easier to do it this way than to write something really generic and then use it for both writers. Does pmtiles use the same metadata format?
it just embeds JSON. However, v3 is going to be a little different by promoting certain metadata fields like minzoom, maxzoom and bounds into fixed-size parts of the header; this enables lower time-to-first-draw since the map viewport can be initialized with a small number of fixed header bytes. Those fields would then be absent from the JSON metadata. So it seems worth refactoring a bit here in order to make metadata not depend on SQLite.
https://github.com/protomaps/tippecanoe/tree/refactor-metadata : WIP on moving the metadata logic out of mbtiles.cpp into a new metadata.cpp; to do: split the behavior based on outdb/outdir/outfile instead of going through mbtiles each time
https://github.com/protomaps/tippecanoe/tree/pmtiles writes tiles to a std::ostream
, completing the tile-writing part of PMTiles, but does not yet write directories, header information, or metadata
- Need a JSON implementation to write metadata (use the one already in tippecanoe)
- Need a hash implementation to perform deduplication (either bring in XXHash dependency, implement FNV, or... is there some way in tippecanoe tile generation to shortcut deduplication check?)
C++ writer implementation is now here, though it does not choose a leaf level:
https://github.com/protomaps/PMTiles/blob/master/cpp/pmtiles.hpp
likely best way is to just inline this header into tippecanoe source tree like other dependencies.
migrated issue to https://github.com/felt/tippecanoe/issues/10