[Gdal-dev] rotations in Get/SetGeoTransform
Stephane Routelous
route at cae.com
Fri Oct 1 11:31:10 EDT 2004
Hi,
I have questions about the parameters of the Get/StegetTransform method.
As reminder :
adfGeoTransform[0] /* top left x */
adfGeoTransform[1] /* w-e pixel resolution */
adfGeoTransform[2] /* rotation, 0 if image is "north up" */
adfGeoTransform[3] /* top left y */
adfGeoTransform[4] /* rotation, 0 if image is "north up" */
adfGeoTransform[5] /* n-s pixel resolution */
void GDALApplyGeoTransform( double *padfGeoTransform,
double dfPixel, double dfLine,
double *pdfGeoX, double *pdfGeoY )
{
*pdfGeoX = padfGeoTransform[0] + dfPixel * padfGeoTransform[1]
+ dfLine * padfGeoTransform[2];
*pdfGeoY = padfGeoTransform[3] + dfPixel * padfGeoTransform[4]
+ dfLine * padfGeoTransform[5];
}
I need to make a driver for GDAL, where the georeferencement of the image is
defined in an XML file with the 4 corners of the image in decimal degrees.
So, I need to transform those 4 points into this transformation matrix.
The other problem I have is that the image can be "stretched". Basically, it
means that I can have the 4 points like :
P1(0,0)
P2(-2,2)
P3(2,3)
P4(4,1)
In this case, the image is not just rectangular and rotated anymore, because
the angle between the x-axis an P1-P4 is different than the angle betwen the
y-axis and P1-P2
what can I do ?
Thanks a lot for your comments.
Stephane
More information about the Gdal-dev
mailing list