Opened 8 years ago

Closed 8 years ago

#6225 closed defect (fixed)

Half pixel shift in geotransform from AAIGRID to GTIFF

Reported by: silyko Owned by: warmerdam
Priority: normal Milestone: 2.0.2
Component: default Version: unspecified
Severity: normal Keywords: geotiff, ascii grid


When doing a gdal_translate on an AAIGRID which uses the xllcenter, yllcenter convention, the georeference of the output tif will be shifted half a pixel / cellsize, IF the input has no SRS and no SRS is attached to output. This is NOT the case, if e.g. attaching a SRS with -a_srs.

As explained by Even Rouault: """This is a defect of the GeoTIFF writer that writes the GeoTIFF Tiepoints with the PixelIsPoint convention (since your original data is flagged as such), but fails to write GTRasterTypeGeoKey=RasterPixelIsPoint as a geotiff key when there's no SRS"""

The geotransform of an AAIGRID, without any SRS, using the "center" convention is read correctly. The first "point" will be half a pixel downwards and rightwards from the upper left corner. Personally, I have always assumed that this is the GDAL-convention, regardless of format and other metadata items - knowing myself whether to interpret values as points or pixels, depending on data.

So I guess that for me the confusing part is the change in geotransform when doing no transformations or interpolations. I do not know if this may apply to other formats as well, or if it is specific to the geotiff driver.

Change History (2)

comment:2 by Even Rouault, 8 years ago

Milestone: 2.0.2
Resolution: fixed
Status: newclosed

trunk r31662, branches/2.0 r31663 "GTiff: correctly set GTRasterTypeGeoKey=RasterPixelIsPoint if AREA_OR_POINT=Point but there is no SRS set (#6225)"

Note: See TracTickets for help on using tickets.