-
Notifications
You must be signed in to change notification settings - Fork 5
How is tile ordering determined for COGs? #37
Description
(modified from a GDAL mailing list post at @rouault's suggestion: https://lists.osgeo.org/pipermail/gdal-dev/2025-January/060017.html)
I’m accustomed to GeoTiff files having row-wise sequential layout of image tiles (GDAL COG driver sorts tiles top-to-bottom,
left-to-right) But I recently was very surprised by a lot of GET requests working with SRTM data that passes COG validation scripts:
https://opentopography.s3.sdsc.edu/raster/SRTM_GL1/SRTM_GL1_srtm/N59W102.tif
I have no idea how this file came about, but the tiles are clearly non-sequential (for example here is excerpt from tiffdump: TileOffsets (324) LONG (4) 64<2269213 2409502 3485315 2716342 …)
This non-contiguous layout prevents merging consecutive GET range-requests:
CPL_DEBUG=ON gdal_translate -srcwin 0 0 1024 512 /vsicurl/https://opentopography.s3.sdsc.edu/raster/SRTM_GL1/SRTM_GL1_srtm/N59W102.tif test.tif
Since a key aspect of COGs is efficient network access, shouldn’t this file not be considered a COG? Or perhaps in the spec, there should be a place to declare the tile ordering so that readers may optimize for the smallest number of range requests?
I see a mention of different ordering schemes like Hilbert curves in this comment
#2 (comment) but not in the spec text.