博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
AE intersect、clip的实现
阅读量:7047 次
发布时间:2019-06-28

本文共 2185 字,大约阅读时间需要 7 分钟。

///         /// rectangle/envelop 裁剪线        ///         ///         ///         /// 
public static IPolyline GetClippedPolyline(IPolyline pPolyLine,IEnvelope pEnvelop) { ISpatialReferenceFactory spatialReferenceFactory = new SpatialReferenceEnvironmentClass(); IGeographicCoordinateSystem gcsSys = spatialReferenceFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCS3Type.esriSRGeoCS_Xian1980); pPolyLine.SpatialReference = gcsSys; pEnvelop.SpatialReference = gcsSys; ITopologicalOperator2 pTopOper = pPolyLine as ITopologicalOperator2; IGeometry pGeoafter=new PolylineClass(); pTopOper.QueryClipped(pEnvelop, pGeoafter); return pGeoafter as IPolyline; }

 备注:intersect和Clip功能一般使用 ITopologicalOperator实现.

         Clip,Intersect等分析,要求各要素有空间参考SpatialReference,否则会出现System.Runtime.InteropServices.COMException错误

        ITopologicalOperator接口能够直接被Point,Polyline,Polygon等要素实现。但不能被TIN实现。

       即  ITopologicalOperator pTopOper=pTin as ITopologicalOperator 获得的pTopOper是Null

 

///         /// 获取多边形和矿层表面的  相交多边形        ///         /// 传入的多边形        /// 矿层表面        /// 
public static IPolygon GetIntersectedRegion(IPolygon pPolygon,ITinSurface pTinsurface) { /*进行Clip和Intersect分析之前,featrue必须设置空间参考,否则出现 *System.Runtime.InteropServices.COMException */ ISpatialReferenceFactory pSpaRefFactory = new SpatialReferenceEnvironmentClass(); IProjectedCoordinateSystem pcsSys = pSpaRefFactory.CreateProjectedCoordinateSystem((int)esriSRProjCS4Type.esriSRProjCS_Xian1980_3_Degree_GK_Zone_39); IPolygon resultPolygon = new PolygonClass(); ITopologicalOperator pTopoOper = pPolygon as ITopologicalOperator; IPolygon pTinPolygon = GetProjectedPolygonFromTin(pTinsurface); pPolygon.SpatialReference = pcsSys; pTinPolygon.SpatialReference = pcsSys; IGeometry otherGeometry = pTinPolygon as IGeometry; resultPolygon =pTopoOper.Intersect(otherGeometry, esriGeometryDimension.esriGeometry1Dimension) as IPolygon; return resultPolygon; }

 

 

 

转载地址:http://tmdol.baihongyu.com/

你可能感兴趣的文章
微信小程序开发之分包
查看>>
使用 Exception 写出优雅的代码
查看>>
我的友情链接
查看>>
在js中如何获取地址栏上的参数呢
查看>>
ELK日志分析单机系统详解
查看>>
MonkenRunner通过HierarchyViewer定位控件的方法和建议(Appium/UIAutomator/Robotium姊妹篇)...
查看>>
[开源] 轻量级移动设备即时通讯技术MobileIMSDK:Android客户端开发指南
查看>>
js函数返回多个返回值的示例代码
查看>>
eclipse.ini内存设置
查看>>
ceph上weight和reweight的区别
查看>>
【路由器API】通过程序控制路由器的各种操作
查看>>
JUULUU kgb2b 龙猫B2B2c商城平台示例上线
查看>>
CentOS 6.3下配置LVM(逻辑卷管理)
查看>>
Flex中的皮肤(二)
查看>>
Linux od 命令
查看>>
我的友情链接
查看>>
What are words
查看>>
android之bundle传递数据--两个activities之间
查看>>
centos You don't have permission to access 解决
查看>>
WPF仿windows图片查看器(附源码)
查看>>