Opened 16 years ago

Closed 16 years ago

#2126 closed defect (duplicate)

Bug in reading georeferencing of geotiff

Reported by: moellney Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

In the attached example the calculation of the adfGeoTransform fails.

The extreme simple example is just one DTM data point at 0° Lat and 0° Long with the extend of 0.0083333333. (downloaded from geoengine.nima.mil).

So the adfGeoTransform should be:

-0.0083333333 / 2
0.0083333333
0.0
0.0083333333 / 2
0.0
-0.0083333333

but we get:

0.0
0.0083333333
0.0
0.0
0.0
-0.0083333333

I think the problem is in geotiff.cpp (http://trac.osgeo.org/gdal/browser/branches/1.5/gdal/frmts/gtiff/geotiff.cpp#L3258 ):

                adfGeoTransform[0] =
                    padfTiePoints[3] - padfTiePoints[0] * adfGeoTransform[1];
                adfGeoTransform[3] =
                    padfTiePoints[4] - padfTiePoints[1] * adfGeoTransform[5];

shouldn't his be more like

                adfGeoTransform[0] =
                    padfTiePoints[3] - (padfTiePoints[0] + 0.5) * adfGeoTransform[1];
                adfGeoTransform[3] =
                    padfTiePoints[4] - (padfTiePoints[1] + 0.5) * adfGeoTransform[5];

to reflect the adfGeoTransform definition to be the upper left corner of the upper left raster area?

And what about the next "if" case for TIFFTAG_GEOTRANSMATRIX: http://trac.osgeo.org/gdal/browser/branches/1.5/gdal/frmts/gtiff/geotiff.cpp#L3270

Just from the "sake of symmetry" it looks wrong, too.

Michael

Attachments (1)

GeoTIFF.tif (588 bytes ) - added by moellney 16 years ago.
Simple geotiff file downloaded from geoengine.nima.mil: Just one DTM point at 0°,0° with extend of 30arcsec.

Download all attachments as: .zip

Change History (2)

by moellney, 16 years ago

Attachment: GeoTIFF.tif added

Simple geotiff file downloaded from geoengine.nima.mil: Just one DTM point at 0°,0° with extend of 30arcsec.

comment:1 by moellney, 16 years ago

Resolution: duplicate
Status: newclosed

Seems to be handled now by: #2178.

Note: See TracTickets for help on using tickets.