ArcGis相接面补节点c#
Posted yzhyingcool
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ArcGis相接面补节点c#相关的知识,希望对你有一定的参考价值。
相接(Touch)面执行切割后 新面与原相接面会缺少公共节点。
1 private void AddPointToTouchesPolygon(IFeatureCursor newFeatureCursor, IFeatureClass featureClass) 2 3 IFeature newFeature = newFeatureCursor.NextFeature(); 4 while (newFeature != null) 5 6 IPointCollection pointCollectionNewFeature = newFeature.Shape as IPointCollection; 7 for (int i = 0; i < pointCollectionNewFeature.PointCount-1; i++) 8 9 ITopologicalOperator pTopologicalOperator = pointCollectionNewFeature.Point[i] as IGeometry as ITopologicalOperator; 10 IGeometry pGeometryPointBuffer = pTopologicalOperator.Buffer(0.001); 11 ISpatialFilter spatialFilter0 = Utils.FilterUtils.SpatialFilter(pGeometryPointBuffer, esriSpatialRelEnum.esriSpatialRelIntersects); 12 IFeatureCursor featureCursor0 = featureClass.Update(spatialFilter0, false); 13 IFeature feature0 = featureCursor0.NextFeature(); 14 while (feature0 != null) 15 16 IPointCollection pointCollection1 = feature0.Shape as IPointCollection; 17 IPoint pointTemp = new PointClass(); 18 int count = 0; 19 for (int k = 0; k < pointCollection1.PointCount-1; k++) 20 21 pointCollection1.QueryPoint(k, pointTemp); 22 if (Math.Abs(pointTemp.X - pointCollectionNewFeature.Point[i].X) < 0.001 && Math.Abs(pointTemp.Y - pointCollectionNewFeature.Point[i].Y) < 0.001) 23 count++; 24 25 if (count == 0) 26 27 pointCollection1.AddPoint(pointCollectionNewFeature.Point[i]); 28 ITopologicalOperator topologicalOperator = feature0.Shape as ITopologicalOperator; 29 topologicalOperator.Simplify(); 30 featureCursor0.UpdateFeature(feature0); 31 featureCursor0.Flush(); 32 33 feature0 = featureCursor0.NextFeature(); 34 35 36 newFeature = newFeatureCursor.NextFeature(); 37 38
欢迎提出改进意见、bug及其解决方案
以上是关于ArcGis相接面补节点c#的主要内容,如果未能解决你的问题,请参考以下文章