[GRASS-dev] Re: gdalwarp -co COMPRESS issues

Frank Warmerdam warmerdam at pobox.com
Fri Mar 14 18:26:49 EDT 2008

Maciej Sieczka wrote:
> Since gdalwarp supports compressing tiffs, who would guess he has to do 
> something extra? gdalwarp makes an impression of being able to warp and 
> compress in one step. Not many users will expect that gdalwarp writes a 
> compressed TIFF bigger than not compressed, and that he has to fix this 
> with gdal_translate afterwards.


While I agree with the above, it does not support your claim that
this affects all gdalwarp users and is somehow an important problem.

> Moreover, I wonder if the guts of the issue that gdalwarp handles 
> compression wrong, might also affect GDAL-dependent software. Eg. 
> r.out.gdal in GRASS - I took the sample [1], imported into GRASS and 
> re-exported with:
> r.in.gdal in=M-33-21-A-b-4.tif out=M-33-21-A-b-4 -o
> g.region rast=M-33-21-A-b-4.red -a
> r.out.gdal in=M-33-21-A-b-4 out=M-33-21-A-b-4_gr_lzw.tif 
> -createopt="COMPRESS=LZW" type=Byte
> which created an LZW-compressed TIFF 2.33 times bigger than the 
> original, also LZW-compressed. Could this r.out.gdal issue be related to 
> gdalwarp issue?

It might, or might not be. It is hard to know without analysis.

All in all, I believe I will discover that if I spend several hours
digging into this problem it will turn out to be the normal result
of losing track of space in the TIFF file each time a tile is
recompressed and gets bigger and thus has to be moved to the end of
the file.  There isn't much I can do about this without spending a
huge effort to have libtiff keep track of all unused space in the file
and manage it on the fly.

So I'm basically not planning to spend any more time on it, and will
likely ignore questions about the topic.

I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org

More information about the grass-dev mailing list