[gdal-dev] Creating Cloud Optimized GeoTIFFs

Even Rouault even.rouault at spatialys.com
Mon Dec 17 15:35:19 PST 2018


> I have run some initial tests on an untiled/uncompressed image basically
> skipping step 1 and going straight to adding overviews and translating to
> reorder, compress, and tile. The resulting image passes the COG validator
> test, meaning it is a "valid" COG, though the overview offset values are
> slightly different:

Did you check with gdalinfo -checksum if the pixel content was identical ?

That's rather surprising. unless your input dataset is JPEG compressed for 
example, in which case the overviews created by gdaladdo will also use JPEG 
compression, whereas if done on tmp.tif they will use DEFLATE. That's the only 
explanation I have for now for the difference you observe.
And in that case, you loose quality, so you may want to use --config 
COMPRESS_OVERVIEW NONE (or DEFLATE) to gdaladdo.

> >>> validate(gdal.Open('tile_first_cog.tif'))
> 
> ... ([], {'ifd_offsets': {'main': 8, 'overview_2': 31886, 'overview_3':
> 32822, 'overview_0': 18238, 'overview_1': 28966}, 'data_offsets': {'main':
> 180166631, 'overview_2': 2300609, 'overview_3': 33246, 'overview_0':
> 45588773, 'overview_1': 11129028}})
> 
> >>> validate(gdal.Open('no_init_tile_cog.tif'))
> 
> ... ([], {'ifd_offsets': {'main': 8, 'overview_2': 31138, 'overview_3':
> 32074, 'overview_0': 17490, 'overview_1': 28218}, 'data_offsets': {'main':
> 180165883, 'overview_2': 2299861, 'overview_3': 32498, 'overview_0':
> 45588025, 'overview_1': 11128280}})
> 
> I am wondering, is there any downside to not starting with an initial
> tiling/compression?

Normally not, apart that might affect speed in a positive or negative way, 
depending on the characteristics of your input dataset (and with the comment I 
made above about lossy compression on the overviews)

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list