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.02k stars 118 forks source link

v3: TileMatrixSets with more than one tile at ID=0 #66

Closed bdon closed 2 years ago

bdon commented 2 years ago

Some common TileMatrixSet definitions (Appendix D http://docs.opengeospatial.org/is/17-083r2/17-083r2.html) do not fit in pyramids because ID 0 has more than one tile. We can define a uint8 TileMatrixIDOffset that translates between zoom levels and Tile IDs, allowing tiles like Z=0 X=1 Y=0 to be addressable by internally shifting it to Z=1 in a way that is handled by the PMTiles implementation.

bdon commented 2 years ago

Discussion from Slack via Blayne:

The original nztm tile matrix had this "feature" https://github.com/linz/NZTM2000TileMatrixSet/blob/master/raw/NZTM2000.json we are recommending most people move to nztm2000quad which is quadkey compatible I believe a few of the Antarctica ones are similar.

https://github.com/developmentseed/morecantile/issues/19#issuecomment-642328960

One of the primary reasons we now recommend using nztm2000quad, there are still a bunch of systems on the older nztm tms as gdal has it as a buitl in one for years

My current thinking is anything that doesn't support a quadkey based index should be changed, because the tile matrix set spec allows for too much variance. Imo if your designing a spec go for the simple but opinionated option! This is mostly from me converting nztm2000quad imagery back into the older nztm2000 tms, it's pretty easy to convert backwards with a simple scale and crop operation.

bdon commented 2 years ago

Conclusion is to exclude non-Quad key compatible TileMatrixSets. Sorry.