Opened 21 years ago

Last modified 21 years ago

#337 closed defect (fixed)

Gtiff format driver projection saving bug

Reported by: soule@… Owned by: warmerdam
Priority: high Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

In the file gdal-1.1.8/frmts/gtiff/geotiff.cpp, lines 1536-1538 in the function
WriteGeoTIFFInfo, the lines:
    if( adfGeoTransform[0] != 0.0 && adfGeoTransform[1] != 1.0
        && adfGeoTransform[2] != 0.0 && adfGeoTransform[3] != 0.0
        && adfGeoTransform[4] != 0.0 && ABS(adfGeoTransform[5]) != 1.0 )
should be:
    if( adfGeoTransform[0] != 0.0 || adfGeoTransform[1] != 1.0
        || adfGeoTransform[2] != 0.0 || adfGeoTransform[3] != 0.0
        || adfGeoTransform[4] != 0.0 || ABS(adfGeoTransform[5]) != 1.0 )
The effect of this bug is that the geotransform and projection are not saved
unless all six geotransform numbers are different from the default.  It could
very well be the case that this function has other logic problems too, but the
change above fixed the problem I was having.

Change History (1)

comment:1 by warmerdam, 21 years ago

This is a known problem, and fixed shortly after the 1.1.8 release in CVS. 
Sorry for the inconvenience digging into this.  

PS. I posted a note to the gdal-dev list about this bug a couple of months ago
since it was fairly serious, though it doesn't affect gdal_translate which uses
the CreateCopy() method.

Note: See TracTickets for help on using tickets.