protomaps / go-pmtiles

Single-file executable tool for working with PMTiles archives
https://docs.protomaps.com/pmtiles/cli
BSD 3-Clause "New" or "Revised" License
373 stars 51 forks source link

Add support for --tile-compression on convert operations. #188

Open lseelenbinder opened 2 weeks ago

lseelenbinder commented 2 weeks ago

This adds the first step towards supporting additional tile compressions in the convert tool.

If a tile-compression flag is passed, then any compression other than gzip is passed-through as-is, assumed to be valid. Also sets the header compression flag as expected.

bdon commented 1 week ago

Is the goal here to convert MBTiles that use non-gzip compression, or to produce archives that use non-gzip compression?

The MBTiles spec is underspecified here (https://github.com/mapbox/mbtiles-spec/blob/master/1.3/spec.md#future-directions) and I don't know of any open source tilers that create archives outside of (no compression | gzip). So I'm not sure how generally applicable this feature / option is until we have a push towards supporting brotli or zstd across the PMTiles ecosystem.

lseelenbinder commented 1 week ago

The initial goal (and what this PR supports directly) is the first, but it opens the door for the second.

You're correct that MBTiles is underspecified, which is why we opted for a flag. We have internal tools that use brotli, and could conceivably used ZSTD when it has broader support. We'd also like to be able to convert gzip'ed mbtiles to other compressions in a single conversion step.