首页 / C# / ArcGis相接面补节点c#
ArcGis相接面补节点c#
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了ArcGis相接面补节点c#,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2475字,纯文字阅读大概需要4分钟。
内容图文
![ArcGis相接面补节点c#](/upload/InfoBanner/zyjiaocheng/798/8b988a842a45436d970c416017c789c7.jpg)
相接(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#全部内容,希望文章能够帮你解决ArcGis相接面补节点c#所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。