[gdal-dev] Sub-optimal access to cloud optimized GeoTIFF

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Tue Dec 12 12:55:13 PST 2017


Hi,

This image http://193.166.24.122/gtk/mp_500000_7500000.tif should be prepared as adviced in https://trac.osgeo.org/gdal/wiki/CloudOptimizedGeoTIFF and the validation script agrees on that.

python c:\temp\validate_cloud_optimized_geotiff.py mp_500000_7500000.tif
Result:
mp_500000_7500000.tif is a valid cloud optimized GeoTIFF

However, it seems to me that gdal_translate is reading the whole GeoTIFF (from byte 0 to 3430936 ) once and then a little bit more (2850413 to 2984219). My command and debug info looks like this:

gdal_translate --config GDAL_DISABLE_READDIR_ON_OPEN YES --config CPL_VSIL_CURL_ALLOWED_EXTENSIONS .tif  -of GTiff -outsize 10% 10% /vsicurl/http://193.166.24.122/gtk/mp_500000_7500000.tif one_tif.tif --debug on
...
HTTP: libcurl/7.37.1 OpenSSL/1.0.1h zlib/1.2.3
VSICURL: GetFileSize(http://193.166.24.122/gtk/mp_500000_7500000.tif)=3430937  response_code=200
VSICURL: Downloading 0-16383 (http://193.166.24.122/gtk/mp_500000_7500000.tif)...
VSICURL: Got response_code=206
VSICURL: Downloading 16384-409599 (http://193.166.24.122/gtk/mp_500000_7500000.tif)...
VSICURL: Got response_code=206
GDAL: GDALOpen(/vsicurl/http://193.166.24.122/gtk/mp_500000_7500000.tif, this=000000000329B420) succ
eeds as GTiff.
Input file size is 10000, 10000
GTiff: ScanDirectories()
VSICURL: Downloading 409600-1196031 (http://193.166.24.122/gtk/mp_500000_7500000.tif)...
VSICURL: Got response_code=206
GTiff: Opened 5000x5000 overview.
VSICURL: Downloading 1196032-2768895 (http://193.166.24.122/gtk/mp_500000_7500000.tif)...
VSICURL: Got response_code=206
GTiff: Opened 2000x2000 overview.
GTiff: Opened 1000x1000 overview.
GTiff: Opened 500x500 overview.
GTiff: Opened 200x200 overview.
VSICURL: Downloading 2768896-3430936 (http://193.166.24.122/gtk/mp_500000_7500000.tif)...
VSICURL: Got response_code=206
GTiff: Opened 100x100 overview.
GDAL: QuietDelete(one_tif.tif) invoking Delete()
GDAL: GDALOpen(one_tif.tif, this=000000000329D090) succeeds as GTiff.
GDAL: GDALDefaultOverviews::OverviewScan()
GDAL: GDALClose(one_tif.tif, this=000000000329D090)
0GDAL: GDAL_CACHEMAX = 802 MB
GDAL: GDALDatasetCopyWholeRaster(): 1000*896 swaths, bInterleave=0
VSICURL: Downloading 2850413-2969284 (http://193.166.24.122/gtk/mp_500000_7500000.tif)...
VSICURL: Download completed
...10...20...30...40...50VSICURL: Downloading 2969285-2984219 (http://193.166.24.122/gtk/mp_500000_7
500000.tif)...
VSICURL: Download completed
...60...70...80...90...100 - done.
GDAL: GDALClose(one_tif.tif, this=000000000329D090)
GDAL: GDALClose(/vsicurl/http://193.166.24.122/gtk/mp_500000_7500000.tif, this=000000000329B420)

I wonder what is going on.

-Jukka Rahkonen-


More information about the gdal-dev mailing list