go-pmtiles icon indicating copy to clipboard operation
go-pmtiles copied to clipboard

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

Open lseelenbinder opened this issue 1 year ago • 2 comments

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.

lseelenbinder avatar Oct 14 '24 15:10 lseelenbinder

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.

bdon avatar Oct 21 '24 20:10 bdon

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.

lseelenbinder avatar Oct 22 '24 10:10 lseelenbinder