使用
tiff3.8.2 和 geotiff1.2.5 读取一个 geotiff 格式的图像,获取图片的经度、纬度和高度值。
1、
经度和纬度可以通过 geotiff 读到栅格坐标和地理坐标的换算关系。
GTIF *gtif ;
int tiepoint_count, count, transform_count;
tiff_t *tif=gtif->gt_tif;
double
*tiepoints =
0;
double *pixel_scale =
0;
double
*transform =
0;
TempKeyData tempData;
if
(!(gtif->gt_methods.get)(tif,
GTIFF_TIEPOINTS,&tiepoint_count,
&tiepoints ))
tiepoint_count = 0;
if
(!(gtif->gt_methods.get)(tif, GTIFF_PIXELSCALE,
&count, &pixel_scale ))
count = 0;
if
(!(gtif->gt_methods.get)(tif,
GTIFF_TRANSMATRIX,&transform_count,
&transform ))
transform_count = 0;
这里用到的是
geotiff 的方法。
ModelTiepointTag (