[gdal-dev] Creating Geotiff is slow

Even Rouault even.rouault at spatialys.com
Tue Jun 16 08:37:49 PDT 2020


> I am puzzled by this behavior... Is there something wrong with my GDAL
> settings ?
> Is there a way to speed up the GeoTIFF creation ? Why is it faster using
> python ?

There might be several factors:

- if with rasterio you read completely the image into memory, and then write it, parallel 
decompression is perhaps more effective. gdal_translate (actually the mechanics behind it) 
tries to use smaller read & write windows by default. You could try to set the 
GDAL_SWATH_SIZE configuration option to 250000000 so that the full band is read at once.

- but I suspect the reason might be due to the Sentinel2 band reporting 15 bits, and 
gdal_translate instructing the GTiff driver to use that setting, whereas I'm not sure if rasterio 
does the same by default. Writing 15 bits / pixel isn't a super fast code path in the GeoTIFF 
driver. You could try adding -co NBITS=16

Even


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200616/4ddd1063/attachment-0001.html>


More information about the gdal-dev mailing list