[Gdal-dev] Re: [GRASS-dev] r.out.gdal vs gdal_translate vs gdalwarp

Glynn Clements glynn at gclements.plus.com
Wed May 9 16:24:11 EDT 2007


Maciej Sieczka wrote:

> Hi
> 
> I have noticed that analogous options settings in r.out.gdal,
> gdal_translate and gdalwarp result in GeoTIFF's of significantly
> different sizes. Sorry for crossposting, but I have no idea if it is
> and issue in GDAL or GRASS.
> 
> Take the following example, based on GRASS spearfish60 location, raster
> elevation.dted:
> 
> $ r.out.gdal in=elevation.dted format=GTiff type=Byte out=grass_copy.tif
> 
> 	grass_copy.tif = 36965 bytes
> 
> $ gdal_translate grass_copy.tif grass_trans_copy.tif
> 
> 	grass_trans_copy.tif = 29153 bytes
> 
> $ gdalwarp grass_copy.tif grass_warp_copy.tif
> 
> 	grass_warp_copy.tif = 36336 bytes
> 
> Each command does only a raw copy of input. Sizes of the r.out.gdal and
> gdalwarp outputs are similar, but the gdal_translate output is 1/6
> smaller. Is that normal?

Analysing the two files with tiffdump, I note:

grass_copy.tif:
StripByteCounts (279) LONG (4) 4<8170 8170 8170 8170>

grass_trans_copy.tif:
StripByteCounts (279) LONG (4) 4<8170 8170 8170 2090>

The difference is 6080 bytes, which is ~3/4 of the 7812 byte
difference between the files. Also:

grass_copy.tif:
34735 (0x87af) SHORT (3) 32<1 1 0 7 1024 0 1 1 1025 0 1 1 1026 34737 33 0 2049 34737 8 33 2054 0 1 9102 ...>
34737 (0x87b1) ASCII (2) 42<UTM Zone 13, Northern He ...>

grass_trans_copy.tif:
34735 (0x87af) SHORT (3) 32<1 1 0 7 1024 0 1 1 1025 0 1 1 1026 34737 21 0 2049 34737 6 21 2054 0 1 9102 ...>
34737 (0x87b1) ASCII (2) 28<NAD27 / UTM zone 13N|NAD ...>

[tag 34735 differs in the 15th field; 33 vs 21; I haven't looked up
the details on that tag, but it's likely to be GeoTIFF.]

-- 
Glynn Clements <glynn at gclements.plus.com>



More information about the Gdal-dev mailing list