[gdal-dev] gdalwarp - Invalid Tiled GTiff

Aaron Sutula Aaron.Sutula at noaa.gov
Thu Oct 9 19:26:38 EDT 2008

Hi List,

I am attempting to create a mosaic of elevation data I have stored as a 
bunch of geotiff files. I am trying this with gdalwarp from FWtools 
2.0.6 (so there is bigtiff support). My approach is to gdalwarp one of 
the source geotiffs into an output geotiff  and specify that the output 
geotiff has a larger extent, my final extent for the mosaic. After that, 
I can gdalwarp the remaining source geotiffs into the first output geotiff.

The odd behaviour I'm noticing is that the initial gdalwarp into a 
geotiff with expanded extents creates an invalid goetiff if I specify an 
extent that is too large. I can't find any reason this is happening. The 
tests I am running are dealing with file sizes less than 4GB so I don't 
think it's a bigtiff issue.

The extent of the source tiff is -102 38 -96 40.

According to gdalinfo, I get a valid geotiff by running the command:

$ gdalwarp -te -102 38 -90.70 45.30 -tr 0.000277777777800 
0.000277777777800 -ot Int16 -srcnodata -3.4028234663852886e+38 
-dstnodata -9999 -co "TILED=YES" 1.tif merge19.tif

$ du merge19.tif
2098568    merge19.tif

$ du 1.tif
608160    1.tif

If I enlarge the extent by just 0.01 degrees or more in the x and y 
directions, I then get an invalid geotiff according to gdalinfo:

$ gdalwarp -te -102 38 -90.69 45.31 -tr 0.000277777777800 
0.000277777777800 -ot Int16 -srcnodata -3.4028234663852886e+38 
-dstnodata -9999 -co "TILED=YES" 1.tif merge18.tif

$ du merge18.tif
2111768    merge18.tif

$ gdalinfo merge18.tif
ERROR 4: `merge18.tif' not recognised as a supported file format.
gdalinfo failed - unable to open 'merge18.tif'.

I just tried running the previous command (which produced an invalid 
geotiff) without -co "TILED=YES" and it gave me a valid geotiff:

$ gdalwarp -te -102 38 -90.69 45.31 -tr 0.000277777777800 
0.000277777777800 -ot Int16 -srcnodata -3.4028234663852886e+38 
-dstnodata -9999 1.tif merge20.tif

$ du merge20.tif
2095204    merge20.tif

Being able to create a tiled geotiff is desirable; gdalwarp ran much 
faster with -co "TILED=YES" and I am under the impression that reading a 
tiled geotiff is more efficient.

Is there a limit on how you can expand the extent of a tiled output 
geotiff using gdalwarp?

Thank you,

p.s. - I am aware of and curious about gdal_merge.py, but when I have 
tried it, it seems much more memory intensive than gdalwarp, especially 
in dealing with large files like mine. Let me know if I should 
investigate gdal_merge.py more. Thanks.

More information about the gdal-dev mailing list