GDAL的GDALDataset::GetGeoTransform()函数

     

      GDALDataset中有函数GetGeoTransform(),函数声明为: CPLErr GDALDataset::GetGeoTransform  ( double *  padfTransform  )。

        GDAL官网对该函数说明为:

        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];

      参数padfTransform是一个指向六个元素的double类型指针,各个元素意义如下:

      In a north up image, padfTransform[1] is the pixel width, and padfTransform[5] is the pixel height. The upper left corner of the upper left pixel is at position (padfTransform[0],padfTransform[3]).

      The default transform is (0,1,0,0,0,1) and should be returned even when a CE_Failure error is returned, such as for formats that don't support transformation to projection coordinates.

 

Parameters:
      padfTransform  an existing six double buffer into which the transformation will be placed.

Returns:
      CE_None on success, or CE_Failure if no transform can be fetched.

 

 //如果图像不含地理坐标信息,默认返回值是:(0,1,0,0,0,1)
 //In a north up image,
 //左上角点坐标(padfGeoTransform[0],padfGeoTransform[3]);
 //padfGeoTransform[1]是像元宽度(影像在宽度上的分辨率);
 /p/adfGeoTransform[5]是像元高度(影像在高度上的分辨率);
 //如果影像是指北的,padfGeoTransform[2]和padfGeoTransform[4]这两个参数的值为0。

 

  • 7
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 9
    评论
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值