页面载入中....
利用ArcEngine创建自己的坐标系统
By  3s4d 发表于 2008-6-16 16:56:00 

//定义坐标的函数
public ISpatialReference createProjection()
        {
            try
            {
                ISpatialReferenceFactory3 spatialReferenceFactory = new SpatialReferenceEnvironmentClass();
                IProjection projection = spatialReferenceFactory.CreateProjection((int)esriSRProjectionType.esriSRProjection_LambertConformalConic);
                ILinearUnit unit = spatialReferenceFactory.CreateUnit((int)esriSRUnitType.esriSRUnit_Meter) as ILinearUnit;
                IParameter[] parameterArray = new IParameter[7];
                parameterArray[0] = spatialReferenceFactory.CreateParameter((int)esriSRParameterType.esriSRParameter_FalseEasting);
                parameterArray[0].Value = 0;
                parameterArray[1] = spatialReferenceFactory.CreateParameter((int)esriSRParameterType.esriSRParameter_FalseNorthing);
                parameterArray[1].Value = 0;
                parameterArray[2] = spatialReferenceFactory.CreateParameter((int)esriSRParameterType.esriSRParameter_CentralMeridian);
                parameterArray[2].Value = 86.59;
                parameterArray[3] = spatialReferenceFactory.CreateParameter((int)esriSRParameterType.esriSRParameter_StandardParallel1);
                parameterArray[3].Value = 30;
                parameterArray[4] = spatialReferenceFactory.CreateParameter((int)esriSRParameterType.esriSRParameter_StandardParallel2);
                parameterArray[4].Value = 60;
                parameterArray[5] = spatialReferenceFactory.CreateParameter((int)esriSRParameterType.esriSRParameter_ScaleFactor);
                parameterArray[5].Value = 1;
                parameterArray[6] = spatialReferenceFactory.CreateParameter((int)esriSRParameterType.esriSRParameter_LatitudeOfOrigin);
                parameterArray[6].Value = -0.64;
                // Create a geographic coordinate system object
                IGeographicCoordinateSystem geographicCoordinateSystem = spatialReferenceFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_WGS1984);
                IProjectedCoordinateSystem projectedCoordinateSystem = new ProjectedCoordinateSystemClass();
                IProjectedCoordinateSystemEdit projectedCoordinateSystemEdit = projectedCoordinateSystem as IProjectedCoordinateSystemEdit;

                object name = "Asia_lambert";
                object alias = "UTM";
                object abbreviation = "TM";
                object remarks = "his PCS is Asia_lambert";
                object usage = "";
                object geographicCoordinateSystemObject = geographicCoordinateSystem;
                object projectedUnitObject = unit;
                object projectionObject = projection;
                object parametersObject = parameterArray;

                projectedCoordinateSystemEdit.Define(ref name,
                                                     ref alias,
                                                     ref abbreviation,
                                                     ref remarks,
                                                     ref usage,
                                                     ref geographicCoordinateSystemObject,
                                                     ref projectedUnitObject,
                                                     ref projectionObject,
                                                     ref parametersObject
                                                     );
                ISpatialReference pRef = projectedCoordinateSystem as ISpatialReference;
                return pRef;
            }
            catch (Exception Excep)
            {
                MessageBox.Show("生成坐标投影系统出现异常,具体异常如下:\n" + Excep.ToString());
                return null;
            }
        }
 
阅读全文 | 回复(0) | 引用通告 | 编辑
  • 标签:AE 
  • 发表评论:
    页面载入中....

     
    站点公告
    页面载入中....
    站点日历
    页面载入中....
    最新日志
    页面载入中....
    最新评论
    页面载入中....
    最新留言
    页面载入中....
    友情链接
    站点统计
    页面载入中....
    日志搜索
    用户登陆
    页面载入中....



     
    Powered by Oblog.