[gdal-dev] how can a Geotiff occupy three times the disk space of an ASCII Grid?

Even Rouault even.rouault at mines-paris.org
Sat Jul 5 08:56:20 PDT 2014


Le samedi 05 juillet 2014 17:25:48, G. Allegri a écrit :
> > QGIS is usually just calls to gdal, which makes this even more
> > mysterious.
> 
> Yes, in the end it uses gdal, but it chooses the way blocks are read and
> written.
> If I remember correctly geotiff final sizes may depend on block ordering
> and memory alignment.

In that instance, the target geotiff has a natural block dimension which is a 
raster line.
If QGIS writes the geotiff by 256x256 blocks (this is just a guess. I've not 
verified), the same raster line will be written several times. As it is a 
compressed geotiff, the resulting raster line will be each time being bigger 
since the initial zeros will be replaced by actual values. And if the new size 
of the line is bigger than its previous size, the new line will be rewritten 
at the end of the file, losing the space previously occupied.

> Maybe this is the case, QGIS raster provider not doing the best at this
> level? Don't know, but this discussion is for the QGIS ml ;)
> 
> giovanni
> 
> > On 7/5/2014 9:09 AM, G. Allegri wrote:
> > > I agree with you David, I'm surprised too.
> > > Anyway, gdal_translate is run without compression options.
> > > I've written to the QGIS devs (it was the software) to verify what's
> > > happening with its raster file writer code...

-- 
Geospatial professional services
http://even.rouault.free.fr/services.html


More information about the gdal-dev mailing list