gdal 坐标系转换

gdal 坐标转换

经纬度转投影坐标系
只需要查找转换前后代号即可
可以http://epsg.io/?q=cgcs2000去搜索
UTM代号可在http://www.jaworski.ca/utmzones.htm查看

实例

WGS 84 / UTM zone 17N 转 WGS 84经纬度

	// 设置投影变化
	OGRCoordinateTransformation *poTransform;
	{
		OGRSpatialReference *RefSource = new OGRSpatialReference;
		RefSource->importFromEPSG(32617);
		OGRSpatialReference *RefTarget = new OGRSpatialReference;
		RefTarget->importFromEPSG(4326);

		auto oPGS = *RefSource;
		std::cout << "SemiMajor->" << oPGS.GetSemiMajor() << std::endl;
		std::cout << "SemiMinor->" << oPGS.GetSemiMinor() << std::endl;
		std::cout << "InvFlattening->" << oPGS.GetInvFlattening() << std::endl;

		poTransform = OGRCreateCoordinateTransformation(RefSource, RefTarget);

		//double tempX = 430400.327;
		//double tempY = 3359421.846;

		//poTransform->Transform(1, &tempX, &tempY);
		//std::cout << tempX << "  " << tempY << std::endl;
	}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值