#include <gdal.h>
#include <gdal_priv.h>
#include <iostream>
float read_elevation(const char* tifFileName, float lon, float lat)
{
// 注册所有功能
GDALAllRegister();
// 打开文件
GDALDatasetH hDS = GDALOpen(tifFileName, GA_ReadOnly);
if (hDS == nullptr)
{
fprintf(stderr, "Can't open %s\n", tifFileName);
return 0.0;
}
int iBand = 1;
GDALRasterBandH hBand = GDALGetRasterBand(hDS<
GDAL读取高程文件,获取经纬度点的高程
最新推荐文章于 2025-05-16 20:47:37 发布