• 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; };
  • 相关阅读:
    获取当前具有输入焦点控件的窗口句柄
    C++日志
    IsWindowVisible
    fedora20 播放aiv视频
    nginx 伪静态大于10个参数 $10
    fedora 安装nginx+php+mysql
    限制图片目录有文件的执行权限
    jQuery制作go to top按钮
    centos 6.5 安装阿里云的一键安装包(nginx+php5.4+mysql5.1)
    centos 6.5网卡dhcp不能获得网关
  • 原文地址:https://www.cnblogs.com/daidaigua/p/3116694.html
Copyright © 2020-2023  润新知