你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
朱新颖
赞同来自:
ITopologicalOperator qTopologicalOperator = qFeature.Shape as ITopologicalOperator;//qFeature为要打断的线要素 IPointCollection qPointCollection = qTopologicalOperator.Intersect(mGeometry, esriGeometryDimension.esriGeometry0Dimension) as IPointCollection; // mGeometry为与其相交的线 IPolyline qPolyline = qFeature.Shape as IPolyline; IEnumVertex enumVertex = qPointCollection.EnumVertices; IPolycurve2 polycurve = qPolyline as IPolycurve2; polycurve.SplitAtPoints(enumVertex,false,true,1); IGeometryCollection geoCol = polycurve as IGeometryCollection; object Missing = Type.Missing; for(int i = 0;i<geoCol.GeometryCount;i++) { IFeature newFea = qFeatureClass.CreateFeature(); IGeometryCollection newPol = new PolylineClass(); IPath geo = new PathClass(); geo = geoCol.get_Geometry(i) as IPath; newPol.AddGeometry(geo as IGeometry,ref Missing, ref Missing); newFea.Shape = newPol as IGeometry; newFea.Store(); }
xiaosi9524 - GISER
要回复问题请先登录或注册
2 个回复
朱新颖
赞同来自:
想要一次性得到所有的打断线可以使用IPolycurve2.SplitAtPoints进行多点的切割。执行完后该IPolyline变为了多个Part,可以转为IGeometryCollection,遍历获取每个部分,新建Feature。参考该部分代码可以实现(前提是两条线有交点)。
xiaosi9524 - GISER
赞同来自:
程序在执行到这句的时候崩溃了 没有任何提示,请问在何种情况下会出现这种情况?(使用直线切割椭圆)
要回复问题请先登录或注册
发起人
相关问题
问题状态
—— 扫技术支持中心微信服务号!
—— 让GIS知乎问答随时随地!