好文档就是一把金锄头!
欢迎来到金锄头文库![会员中心]
电子文档交易市场
安卓APP | ios版本
电子文档交易市场
安卓APP | ios版本

AE中及坐标系统转换.doc

8页
  • 卖家[上传人]:豆浆
  • 文档编号:19079560
  • 上传时间:2017-11-18
  • 文档格式:DOC
  • 文档大小:47.50KB
  • / 8 举报 版权申诉 马上下载
  • 文本预览
  • 下载提示
  • 常见问题
    • AE 中的坐标系统转换ArcEngine 开发总结 2008-09-04 22:47:33 阅读 405 评论 0 字号:大中小 在搞 AE 开发的时候,经常碰到的一个问题就是不同坐标系统之间的转换,AE 中 IGlobeControl 控件中提供了 IGlobeViewUtil 类实现了大地坐标、屏幕坐标和地理坐标三者之间的转换,IMapControl 中则提供了 ToMapPoint 和 FromMapPoint 两种方法实现屏幕坐标和地理坐标之间的转换,但在实际开发中,这些转换还不够,比如当我们需要实现地理坐标转换到自定义格式的大地坐标时,上述方法则不能解决这些问题,最好的解决方法是使用 IGeometry 对象的 Project 方法,实现不同空间参照系之间的相互转换以下以地理坐标转为自定义的 Albers 坐标系统为例予以说明,其主要用到的接口有ISpatialReferenceFactory、IProjectedCoordinateSystem 、IProjectedCoordinateSystemEdit 、ISpatialReferenceFactory、IGeographicCoordinateSystem 、ISpatialReference 等:其 C#代码如下://将任意坐标系统转换为自定义 Albers 大地坐标(米)public static IPoint GeoToGra(IPoint point){IPoint pt = new PointClass();pt.PutCoords(point.X,point.Y);ISpatialReferenceFactory2 pFact = new SpatialReferenceEnvironmentClass();//定义地理坐标,由输入的对象决定,也可以自己定义,参考: esriSRGeoCSTypeIGeographicCoordinateSystem pGCS = new GeographicCoordinateSystemClass();pGCS = pFact.CreateGeographicCoordinateSystem(point.SpatialReference.FactoryCode);//自定义投影方式IProjectedCoordinateSystem pProjectedCS = new ProjectedCoordinateSystemClass();IProjectedCoordinateSystemEdit pProjectedCSEdit = pProjectedCS as IProjectedCoordinateSystemEdit;//定义投影方式,参考: esriSRProjectionTypeIProjection pProjection = new ProjectionClass();pProjection = pFact.CreateProjection((int)esriSRProjectionType.esriSRProjection_Albers);//定义投影单位,参考:esriSRUnitTypeILinearUnit pUnit = new LinearUnitClass();pUnit = pFact.CreateUnit((int)esriSRUnitType.esriSRUnit_Meter) as ILinearUnit;//定义其他参数,参考:esriSRParameterTypeIParameter[] pParm = new IParameter[6];pParm[0] = pFact.CreateParameter((int)esriSRParameterType.esriSRParameter_FalseEasting);pParm[0].Value = 0;pParm[1] = pFact.CreateParameter((int)esriSRParameterType.esriSRParameter_FalseNorthing);pParm[1].Value = 0;pParm[2] = pFact.CreateParameter((int)esriSRParameterType.esriSRParameter_CentralMeridian);pParm[2].Value = 110;pParm[3] = pFact.CreateParameter((int)esriSRParameterType.esriSRParameter_StandardParallel1);pParm[3].Value = 25;pParm[4] = pFact.CreateParameter((int)esriSRParameterType.esriSRParameter_StandardParallel2);pParm[4].Value = 47;pParm[5] = pFact.CreateParameter((int)esriSRParameterType.esriSRParameter_LatitudeOfOrigin);pParm[5].Value = 0;//设置投影相关信息object name = "User_Defined_Albers";object alias = "Albers";object abbreviation = "Albers";object remarks = "User_Defined_Albers is the projection";object usage = "";object gcs = pGCS;object projectedUnit = pUnit;object projection = pProjection;object parameters = pParm;pProjectedCSEdit.Define(ref name, ref alias, ref abbreviation, ref remarks, ref usage, ref gcs, ref projectedUnit, ref projection, ref parameters);//获取自定义空间参考ISpatialReference pSpatialRef = pProjectedCS as ISpatialReference;IGeometry pGeometry = (IGeometry)pt;pGeometry.SpatialReference = pGCS as ISpatialReference;//重投影处理pGeometry.Project(pSpatialRef);return pt;} //将平面坐标转换为地理坐标 WGS1984(经纬度)public static IPoint GetGeo(IGeometry pg){IPoint pt = new PointClass();pt.PutCoords(pg.Envelope.XMax, pg.Envelope.YMax); //这里 IGeometry 对象可换成 IPoint 等对象ISpatialReferenceFactory2 spatialReferenceFact = new SpatialReferenceEnvironmentClass();IGeometry geo = (IGeometry)pt;geo.SpatialReference = spatialReferenceFact.CreateProjectedCoordinateSystem(pg.SpatialReference.FactoryCode);ISpatialReference pSR = spatialReferenceFact.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_WGS1984);geo.Project(pSR); return pt;}以上实现可以参考 ESRI 提供的相关帮助示例文档:IProjectedCoordinateSystemEdit_Define_Example、CreateParameter_Example 、ISpatialReferenceFactory_Example、CreateProjection_Example、CreateUnit_ExampleCreateGeographicCoordinateSystem_Example、CreateProjectedCoordinateSystem_Example自定义不同的坐标系统,需要设置不同的参数,所有的地图投影都必须有 FalseEasting 和 FalseNorthing 两个参数,每种不同投影的其他参数的参数如下所示,具体参照:IProjectedCoordinateSystemEdit InterfaceAitoffCentralMeridian AlbersCentralMeridian StandardParallel1StandardParallel2LatitudeOfOrigin Azimuthal_EquidistantCentralMeridian LatitudeOfOrigin BehrmannCentralMeridian BonneCentralMeridian StandardParallel1CassiniCentralMeridian ScaleFactor LatitudeOfOrigin Craster_ParabolicCentralMeridian Cylindrical_Equal_AreaCentralMeridian StandardParallel1Double_StereographicCentralMeridian ScaleFactor LatitudeOfOrigin Eckert_ICentralMeridian Eckert_IICentralMeridian Eckert_IIICentralMeridian Eckert_IVCentralMeridian Eckert_VCentralMeridian Eckert_VICentralMeridian Equidistant_ConicCentralMeridian StandardParallel1StandardParallel2LatitudeOfOrigin Equidistant_CylindricalCentralMeridian StandardParallel1Flat_Polar_QuarticCentralMeridian Gall_StereographicCentralMeridian Gauss_KrugerCentralMeridian ScaleFactor LatitudeOfOrigin GnomonicLongitudeOfCenter LatitudeOfCenter Hammer_AitoffCentralMeridian Hotine_Oblique_Mercator_Azimuth_CenterScaleFactor Azimuth LongitudeOfCenter LatitudeOfCenter Hotine_Oblique_Mercator_Azimuth_Natural_OriginScaleFactor Azimuth LongitudeOfCenter LatitudeOfCenter Hotine_Oblique_Mercator_Two_Point_CenterLatitudeOf1stLatitudeOf2ndScaleFactor Lon。

      点击阅读更多内容
      猜您喜欢
      北京市西城区(北区)2012-2013学年高二下学期期末考试英语试题含答案.doc Analysis- Tencent like what kind of entrepreneur- Tencent investment and M & A logical interpretation(分析-腾讯喜欢什么样的企业家u2014u2014腾讯投资和M,).doc 复习用:蛋白质、核酸的结构和功能.ppt Analysis- Tencent QQ flaw of things, build a micro-channel(分析-腾讯QQ的缺陷,建立一个微通道).doc 北京市西城区(南区)2011-2012学年高二下学期期末考试历史试题.doc 复习研讨课——顾小华.ppt 北京市西城区(南区)2011-2012学年高二下学期期末考试数学(理科)试题.doc Analysis- Tencent's interpretation of a large platform strategy(分析-腾讯# 39;大平台战略的解释).doc 北京市西城区(南区)2011-2012学年高二下学期期末考试英语试题.doc Analysis- Tencent, the same as building a national construction company(分析-腾讯一样建立一个国家的建筑公司).doc 北京市西城区(南区)2011-2012学年高二下学期期末考试语文试题.doc 接触网硬点的查找.doc 北京市西城区(南区)2012-2013学年高一上学期期末考试化学试题含答案.doc 北京市西城区(南区)2012-2013学年高一上学期期末考试化学试题含解析.doc 三星RS26MBZBL冰箱附件拆卸方法.pdf 北京市西城区(南区)2012-2013学年高一上学期期末考试历史试题含答案.doc 全程复习构想2016高考化学大一轮复习 13.2官能团与有机反应 烃的衍生物同步检测.doc 北京市西城区(南区)2012-2013学年高一上学期期末考试地理试题含答案.doc Analysis- textile machinery parts industry into the electricity supplier of the road(分析-纺织机械零部件行业的电力供应商).doc AE层模式混合模式图像视频格式.doc
      关于金锄头网 - 版权申诉 - 免责声明 - 诚邀英才 - 联系我们
      手机版 | 川公网安备 51140202000112号 | 经营许可证(蜀ICP备13022795号)
      ©2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.