Arcengine经纬度转米

Posted tttttye-cnblogs

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Arcengine经纬度转米相关的知识,希望对你有一定的参考价值。

投影转经纬度
private IPoint PRJtoGCS( double x, double y)
{
    IPoint pPoint = new PointClass();
    pPoint.PutCoords(x, y);
    ISpatialReferenceFactory pSRF = new SpatialReferenceEnvironmentClass();
    pPoint.SpatialReference = pSRF.CreateProjectedCoordinateSystem( 2414 );
pPoint.Project(pSRF.CreateGeographicCoordinateSystem(( int)esriSRGeoCSType.esriSRGeoCS_Beijing1954));
    return pPoint;
}

 
其中,pPoint.SpatialReference = pSRF.CreateProjectedCoordinateSystem( 2414 );
这行代码是设置pPoint 的空间参考,也就是要转化的点的投影坐标。如果不知道投影坐标的话,转化会报异常。
2414 为该投影的enum 值
pPoint.Project(pSRF.CreateGeographicCoordinateSystem(( int)esriSRGeoCSType.esriSRGeoCS_Beijing1954));
将该点的投影坐标转化为经纬度。
 
经纬度到投影:
private IPoint GCStoPRJ(IPoint pPoint)
{
            ISpatialReferenceFactory pSpatialReferenceFactory = new SpatialReferenceEnvironment();
            pPoint.SpatialReference = pSpatialReferenceFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_Krasovsky1940);
            IProjectedCoordinateSystem pProjectCoodinateSys = pSpatialReferenceFactory.CreateProjectedCoordinateSystem((int)esriSRProjCS4Type.esriSRProjCS_Xian1980_GK_Zone_17);
            ISpatialReference pSpatialReference = (ISpatialReference)pProjectCoodinateSys;
            pSpatialReference.SetDomain(17352988.066800, 18230892.557100, 2326007.173500, 3237311.062300);
            pPoint.Project(pSpatialReference);
}

  

以上是关于Arcengine经纬度转米的主要内容,如果未能解决你的问题,请参考以下文章

Arcengine调用GP服务

arcengine 怎么加载DEM数据呀 求C#代码

C#-ArcEngine 图层属性查询的部分代码

ArcEngine连接Oracle数据库

arcengine模糊查询不起作用

ArcEngine 数据导出Shape的几种方式