[gdal-dev] GeoTransform confusion

Simon Lyngby Kokkendorff silyko at gmail.com
Wed Nov 18 12:38:58 PST 2015


Hi List,

  I have a geoid in AAIGRID-format, with the following header:

ncols 1001
nrows 731
xllcenter 400000.0
yllcenter 6045000.0
cellsize 500.0
NODATA_value 9999

GDAL will read this just fine, and report:

Driver: AAIGrid/Arc/Info ASCII Grid
Files: dkgeoid13b.utm32
Size is 1001, 731
Coordinate System is `'
Origin = (399750.000000000000000,6410250.000000000000000)
Pixel Size = (500.000000000000000,-500.000000000000000)
Metadata:
  AREA_OR_POINT=Point
Corner Coordinates:
Upper Left  (  399750.000, 6410250.000)
Lower Left  (  399750.000, 6044750.000)
Upper Right (  900250.000, 6410250.000)
Lower Right (  900250.000, 6044750.000)
Center      (  650000.000, 6227500.000)
Band 1 Block=1001x1 Type=Float32, ColorInterp=Undefined
  NoData Value=9999

As expected, the upper left corner is shifted half a pixel. It is my
understanding, that GDAL (GetGeoTransform) always uses the xulcorner,
yulcorner (pixel) interpretation. However, I was suprised to see that after
a

gdal_translate dkgeoid13b.utm32 hello.tif,  I get:

>gdalinfo hello.tif
Driver: GTiff/GeoTIFF
Files: hej.tif
Size is 1001, 731
Coordinate System is `'
Origin = (400000.000000000000000,6410000.000000000000000)
Pixel Size = (500.000000000000000,-500.000000000000000)
Image Structure Metadata:
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  400000.000, 6410000.000)
Lower Left  (  400000.000, 6044500.000)
Upper Right (  900500.000, 6410000.000)
Lower Right (  900500.000, 6044500.000)
Center      (  650250.000, 6227250.000)
Band 1 Block=1001x2 Type=Float32, ColorInterp=Gray
  NoData Value=99

The GeoTransform is not shifted half a pixel, and is not the same as the
AAIGRID i ran gdal_translate on?? So, I would have to interpret now the
GeoTransform as xulcenter and yulcenter. This came as a suprise, and led to
some bugs in our processing software.

Is this to be expected??

Cheers,
Simon Kokkendorff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20151118/fa43c6c5/attachment.html>


More information about the gdal-dev mailing list