• c++进行经纬度坐标与平面坐标转换(转)


    原文地址:http://www.cnblogs.com/ayanmw/archive/2012/08/19.html
    IPoint
    * projToGeo(IPoint* point/*需要更改坐标系的点*/,long fromProjType=3857 ,long toGeoType=4326) { long geoType = toGeoType;//4326; IPoint* points = point; ISpatialReference* spatialRf; ISpatialReference* spatialRf1; IGeographicCoordinateSystem* geograpicsys; IProjectedCoordinateSystem*projCoordSystem; ISpatialReferenceFactoryPtr originalSpecialReference; ISpatialReferenceFactoryPtr newReferenceSystem; HRESULT hr = originalSpecialReference.CreateInstance(CLSID_SpatialReferenceEnvironment); HRESULT hr1 = originalSpecialReference->CreateProjectedCoordinateSystem(fromProjType,&projCoordSystem); spatialRf = (ISpatialReference*)projCoordSystem; HRESULT hr2 = points->putref_SpatialReference(spatialRf); newReferenceSystem.CreateInstance(CLSID_SpatialReferenceEnvironment); newReferenceSystem->CreateGeographicCoordinateSystem(geoType,&geograpicsys); spatialRf1 = (ISpatialReference*)geograpicsys; //points->putref_SpatialReference(spatialRf1);//这句不能要是设置原始 空间参考的。 points->Project(spatialRf1); ////测试输出而已//////////////////////// //double x,y; //points->get_X(&x); //points->get_Y(&y); //printf("x=%lf,y=%lf\n",x,y); /////////////////////////////////////// return points; };
  • 相关阅读:
    租店笔记
    pycharm debug调试【Mute Breakpoints】【Run to Curson】按钮
    教师岗位职业技能分享—备课小秘籍
    交换机基础
    路由基础
    IPv6端口转发联机软件 4to6
    数据库_关键词用法
    1_Shell脚本入门
    MySQL_linux下mysql数据库自动定时备份
    Unity URP 安装配置
  • 原文地址:https://www.cnblogs.com/daidaigua/p/3116694.html
Copyright © 2020-2023  润新知