arcgis开发集锦(编辑修改稿)内容摘要:

21483 仅仅把北京附近的地球平面拉伸铺在平面上,由于投影面积变小,所以投影经度提高。 但是由于面积变小 ,所以有些经度纬度不能转换,比如所美国的精度纬度用北京投影就投不了。 flatref = (54013)。 //没什么说的,标准大地经纬度,可以将 XY逆投影为经度和纬度 earthref = ((int))。 /// 将经纬度点 转换为平面坐标。 private IPoint GetProject(double x, double y) { IPoint pt = new PointClass()。 (x, y)。 IGeometry geo = (IGeometry)pt。 = earthref。 (flatref)。 return pt。 } /// 将平面坐标转换为经纬度。 private IPoint GetGeo(double x, double y) { IPoint pt = new PointClass()。 (x, y)。 IGeometry geo = (IGeometry)pt。 = flatref。 (earthref)。 double xx =。 return pt。 }实际上 IPoint 的投影和任何地图都没什么大关系,完全可以不用地图,直接调用 IPoint 进行投影的转换 6. ArcEngine 中使用上下左右键移动地图功能的实现 //闪烁目标 public static void FlashFeature(AxMapControl mapControl,IFeature iFeature, IMap iMap) { IActiveView iActiveView = iMap as IActiveView。 if (iActiveView != null) { (0, (short))。 //根据几何类型调用不同的过程 switch () { case : FlashLine(mapControl, , )。 break。 case : FlashPolygon(mapControl, , )。 break。 case : FlashPoint(mapControl, , )。 break。 default: break。 } ()。 } } //闪烁线 static void FlashLine(AxMapControl mapControl,IScreenDisplay iScreenDisplay,IGeometry iGeometry) { ISimpleLineSymbol iLineSymbol。 ISymbol iSymbol。 IRgbColor iRgbColor。 iLineSymbol = new SimpleLineSymbol()。 = 4。 iRgbColor = new RgbColor()。 = 255。 = iRgbColor。 iSymbol = (ISymbol)iLineSymbol。 =。 (iGeometry, 3, 200, iSymbol)。 } //闪烁面 static void FlashPolygon(AxMapControl mapControl, IScreenDisplay iScreenDisplay, IGeometry iGeometry) { ISimpleFillSymbol iFillSymbol。 ISymbol iSymbol。 IRgbColor iRgbColor。 iFillSymbol = new SimpleFillSymbol()。 =。 = 12。 iRgbColor = new RgbColor()。 = (100, 180, 180).ToArgb()。 = iRgbColor。 iSymbol = (ISymbol)iFillSymbol。 =。 (iSymbol)。 (iGeometry, 3, 200, iSymbol)。 } //闪烁点 static void FlashPoint(AxMapControl mapControl, IScreenDisplay iScreenDisplay, IGeometry iGeometry) { ISimpleMarkerSymbol iMarkerSymbol。 ISymbol iSymbol。 IRgbColor iRgbColor。 iMarkerSymbol = new SimpleMarkerSymbol()。 =。 iRgbColor = new RgbColor()。 = (0, 0, 0).ToArgb()。 = iRgbColor。 iSymbol = (ISymbol)iMarkerSymbol。 =。 (iGeometry, 3, 200, iSymbol)。 } 7. 缓冲区的创建 蓝蓝的小志 发表于 202065 10:07:08 本文以面图层为例,并且把创建的缓冲区就存储在面图层中,当然也可以把创建的缓冲区另存为一个新的图层。 程序运行环境( .NET+ AO) 代码如下: Private Sub ITopologicalOperator_Buffer(ByVal pFeatLyr As , ByVal distance As Double, Optional ByVal pFeatClass As = Nothing) 39。 pFeatLyr 为面图层 39。 distance 缓冲距离 Dim pFeatureClass As Dim pTopoOper As Dim pBufferPoly As Dim pFeatCursor As Dim pFeature As Try pFeatureClass = pFeatCursor = (Nothing, False) pFeature = Do If Not (pFeature Is Nothing) Then pTopoOper = () pBufferPoly = (distance) 39。 pFeature = = pBufferPoly () pFeature = () End If Loop Until (pFeature Is Nothing) Catch MsgBox(, , 错误提示 ) pFeature = Nothing pFeatCursor = Nothing pBufferPoly = Nothing pTopoOper = Nothing pFeatureClass = Nothing pFeatLyr = Nothing End Try pFeature = Nothing pFeatCursor = Nothing pBufferPoly = Nothing pTopoOper = Nothing pFeatureClass = Nothing pFeatLyr = Nothing End Sub 8. C制作鹰眼全过程 (引自 ESRI 中国社区 ) 1. axMapControl1是主控件, axMapControl2是鹰眼控件 2. 3. private void axMapControl1_OnMapReplaced(object sender, IMapControlEvents2_OnMapReplacedEvent e) 4. { 5. //当主地图显示控件的地图更换时,鹰眼中的地图也跟随更换 6. ()。 7. =。 8. } 9. 10. private void axMapControl1_OnExtentUpdated(object sender, IMapControlEvents2_OnExtentUpdatedEvent e) 11. { 12. // 得到新范围 13. IEnvelope pEnv = (IEnvelope)。 14. IGraphicsContainer pGra = as IGraphicsContainer。 15. IActiveView pAv = pGra as IActiveView。 16. //在绘制前,清除 axMapControl2中的任何图形元素 17. ()。 18. IRectangleElement pRectangleEle = new RectangleElementClass()。 19. IElement pEle = pRectangleEle as IElement。 20. = pEnv。 21. //设置鹰眼图中的红线框 22. IRgbColor pColor = new RgbColorClass()。 23. = 255。 24. = 0。 25.。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。