[gdal-dev] Affine parameters in the gdal datamodel doc

Even Rouault even.rouault at spatialys.com
Fri Jan 9 01:39:00 PST 2015


Le vendredi 09 janvier 2015 09:33:04, Jukka Rahkonen a écrit :
> Hi,
> 
> I am trying to understand the geotransform parameters by reading
> http://www.gdal.org/gdal_datamodel.html but I am confused. In the Affine
> GeoTransform section there are formulas
> 
>     Xgeo = GT(0) + Xpixel*GT(1) + Yline*GT(2)
>     Ygeo = GT(3) + Xpixel*GT(4) + Yline*GT(5)
> 
> The latter formula feels odd to me and I think that it should rather be
> 
>     Xgeo = GT(0) + Xpixel*GT(1) + Yline*GT(2)
>     Ygeo = GT(3) + Ypixel*GT(5) + Xline*GT(4)

Jukka,

That would look more odd to me ;-) since it would seem to add 2 new variables 
to the equations (but perhaps that was just a typo, and you wanted only to 
switch the 2 terms of the addition ?)
In the original equation, my guess is that Xpixel means "X or pixel or column" 
and Yline means "Y or line or row", according to the terminology people use.

The equations are just the result of the standard matrix multiplication for a 
2D affine transformation : 

[   1     ]          [   1           0         0       ]       [    1      ]
[  Xgeo ]   =    [   GT(0)   GT(1)   GT(2) ]  *    [ Xpixel  ]
[  Ygeo ]          [   GT(3)   GT(4)   GT(5) ]  *    [ Yline    ]

(usually you put the 1 at the bottom and right of the matrices, but that's 
only a presentation change)

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list