这里要使用的一个比较重要的函数是GetGeoTransform函数,GDAL官网的API中对GetGeoTransform的解释如下:
CPLErr GDALDataset::GetGeoTransform ( double * padfTransform )
virtual
Fetch the affine transformation coefficients.
Fetches the coefficients for transforming between pixel/line (P,L) raster space, and projection coordinates (Xp,Yp) space.
Xp = padfTransform[0] + P*padfTransform[1] + L*padfTransform[2];
Yp = padfTransform[3] + P*padfTransform[4] + L*padfTransform[5];
In a north up image, padfTransform[1] is the pixel width, and padfTransform[5] is