ArcEngine判断要素(feature)是否为multipart feature及分解(炸开)代码
转自原文 ArcEngine判断要素(feature)是否为multipart feature及分解(炸开)代码
#region 校验合法性 ArrayList pFeatureArray = null; pFeatureArray = Application.Editor.FeatureSelection(); int count=pFeatureArray.Count; if (count<1) { MessageBox.Show("最少必须选择1个要素才能进行要素分解!", "提示"); return; } #endregion try { //启动编辑操作 Application.Editor.StartOperation(); #region 对选中的要素进行多部件测试及分解 int multipartcount = 0; for (int i = 0; i < count; i++) { IFeature pFeature = pFeatureArray as IFeature; if (pFeature.ShapeCopy.IsEmpty) continue; IGeometry pGeometry = pFeature.ShapeCopy; IGeometryCollection pGeocoll = pGeometry as IGeometryCollection; int geomcount = pGeocoll.GeometryCount; if (geomcount > 1) { multipartcount++; for (int k = 1; k < geomcount; k++) { IFeature newFeaturte = (pFeature.Class as IFeatureClass).CreateFeature(); IFeatureEdit pFeatureEdit = pFeature as IFeatureEdit; pFeatureEdit.SplitAttributes(newFeaturte); IGeometry newGeom = pGeocoll.get_Geometry(k); if (pFeature.ShapeCopy.GeometryType == esriGeometryType.esriGeometryPolygon) newGeom=GeometryHelper.ConstructPolygon(newGeom); else newGeom = GeometryHelper.ConstructPolyline(newGeom); newGeom.SpatialReference = pFeature.ShapeCopy.SpatialReference; newFeaturte.Shape = newGeom; newFeaturte.Store(); } IGeometry newGeom2 = pGeocoll.get_Geometry(0); if (pFeature.ShapeCopy.GeometryType == esriGeometryType.esriGeometryPolygon) newGeom2 = GeometryHelper.ConstructPolygon(newGeom2); else newGeom2 = GeometryHelper.ConstructPolyline(newGeom2); newGeom2.SpatialReference = pFeature.ShapeCopy.SpatialReference; pFeature.Shape = newGeom2; pFeature.Store(); Application.Editor.StopOperation("分解多部件要素"); } else { continue; } } if (multipartcount == 0) { MessageBox.Show("未选择多部件要素!", "分解要素"); return; } #endregion } catch (Exception ex) { Application.Editor.AbortOperation(); MessageHelper.WriteLog("分解多部件要素", ex); } finally { Application.ActiveView.Refresh(); FlashFeatures(); }
ArcEngine判断要素(feature)是否为multipart feature及分解(炸开)代码相关推荐
- 基于C#的ArcEngine二次开发46:编辑内容回撤与炸开multipart feature
目录 1 支持撤销操作 1.1 方法接口介绍 1.1.1 StartOperation() 1.1.2 StopOperation 1.2 代码实现 2 炸开复合要素(explode multipar ...
- CNN:low-level feature 和 high level feature 的理解
通常卷积神经网络中都会使用这两种类型的features: 卷积神经网络的前几层学习low level feature,后几层学习的是high level feature 文章目录 一.low-leve ...
- 【Debug日记】fatal: cannot lock ref ‘refs/heads/feature/CXX_Config‘: ‘refs/heads/feature‘ exists;
针对已有项目进行GitFlow管理时,容易出现如下BUG: fatal: cannot lock ref'refs/heads/feature/CXX_Config': 'refs/heads/fea ...
- 【Machine Learning 学习笔记】feature engineering中noisy feature的影响
[Machine Learning 学习笔记]feature engineering中noisy feature的影响 通过本篇博客记录一下添加噪声对Lasso和SVM的影响,采用的数据集为sklea ...
- 论文阅读:AF2S3Net:Attentive Feature Fusion with Adaptive Feature Selection for Sparse Semantic
题目:(AF)2-S3Net: Attentive Feature Fusion with Adaptive Feature Selection for Sparse Semantic Segment ...
- 由浅入深CIL系列:5.抛砖引玉:判断string是否为空的四种方法的CIL代码看看效率如何?...
本节将接触几个新的CIL操作码如下 ldc.i4.0 将整数值 0 作为 int32 推送到计算堆栈上 Ceq 比较两个值.如果这两个值相等,则将整数值 1 (int32) ...
- 14.String常量池:什么是字符常量???常量池在内存空间中的位置在哪里???判断s7、s8、s9是不是字符常量???代码
14.String常量池:什么是字符常量???常量池在内存空间中的位置在哪里???判断s7.s8.s9是不是字符常量???代码 学习:第3遍 1.什么是字符常量??? 使用双引号直接创建的字符串 称为 ...
- Arcgis Javascript那些事儿(四)--feature access服务编辑feature本质
Arcgisserver发布的feature server中数据存储位置和原理 1.当arcgisserver发布时会在下面复制sde中数据库的数据,显示在高亮文件夹(该图片已经删除sde数据库),首 ...
- ArcEngine实现要素类排序的四种方法
ArcEngine的排序方法有多种,下面介绍一下主要的四种方法. 准备数据 测试数据如下图所示:新建一个Geodatabase的要素类,其中Name为道路名称,Width为道路宽度,下面将根据Widt ...
最新文章
- jquery 点击计数器
- java学习笔记第三章
- vector的resize()和reserve()函数
- 1 字节的 utf-8 序列的字节 1 无效_记住:永远不要在MySQL中使用UTF8
- python和tensorflow版本对应_详解Tensorflow不同版本要求与CUDA及CUDNN版本对应关系
- 【算法】图文并茂,一文了解 8 种常见的数据结构
- 从代码角度揭示:华为鸿蒙的“套壳”真相!
- Hadoop入门(九)Mapreduce高级shuffle之Combiner
- php置顶文章,zblogphp调用置顶文章的教程
- java 继承变量_用java中的变量继承
- Ibatis - Open quote is expected for attribute {1} associated with an element type '
- java程序设计_Java程序设计--接口interface(笔记)
- P2030 - 【BJOI2006】狼抓兔子
- Code Style Guidelines for Contributors Reading Notes
- oracle sql core目录,oracle11g数据库常见故障处理.ppt
- (day 24 - 广度优先搜索 )剑指 Offer 32 - I. 从上到下打印二叉树
- 【劲峰论道时空分析技术-学习笔记】3 时空演化树
- 基于单片机和C语言的毕业设计,毕业论文基于51单片机的C语言程序设计实训100例(1)(喜欢就下吧)...
- 搜索的近义词php,挖掘关键词同义的近义词提高排名
- bulkwrite 批量插入_使用EF扩展EntityFramework.BulkInsert实现批量插入
热门文章
- Ran out of input
- 去雾综述_【综述】图像去雾的前世今生
- java awt 初始化_Java awt项目开发
- java 线程栈空间_java线程的内存不包含在JVM堆与栈中
- Python日志详解【两篇就够了系列】--第一篇logging
- 天翼云从业认证【考前半小时的30句话】
- springBoot第二数据源访问dao 报BindingException: Invalid bound statement(not found)
- An error occurred. connect() failed (111: Connection refused) while connecting to upstream
- 消息队列-RabbitMq(PHP)
- 'pip3' 不是内部或外部命令,也不是可运行的程序或批处理文件