转自原文 ArcEngine判断要素(feature)是否为multipart feature及分解(炸开)代码

#region 校验合法性
ArrayList pFeatureArray = null;
pFeatureArray = Application.Editor.FeatureSelection();
int count=pFeatureArray.Count;
if (count<)
{
MessageBox.Show("最少必须选择1个要素才能进行要素分解!", "提示");
return;
}
#endregion
try
{
//启动编辑操作
Application.Editor.StartOperation();
#region 对选中的要素进行多部件测试及分解
int multipartcount = ;
for (int i = ; 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 > )
{
multipartcount++;
for (int k = ; 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();
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 == )
{
MessageBox.Show("未选择多部件要素!", "分解要素");
return;
} #endregion
}
catch (Exception ex)
{
Application.Editor.AbortOperation();
MessageHelper.WriteLog("分解多部件要素", ex);
}
finally
{
Application.ActiveView.Refresh();
FlashFeatures();
}

ArcEngine判断要素(feature)是否为multipart feature及分解(炸开)代码的更多相关文章

  1. arcengine新建要素类

    ArcGIS里面新建数据集,看起来简单,平时都是默认创建,实际上好多细节问题我们都没注意到 一.在数据集上新建要素类: How to create a feature class within a f ...

  2. Arcengine 实现要素选取的方法(转载)

    转自原文Arcengine 实现要素选取的方法(转载) 选择一个要素或者一个要素集(FeatureSelection)的方法很多,如IMap::SelectByShape.ILayer::search ...

  3. ArcEngine 创建要素,删除要素,生成网格,渲染图层(VB)

    示例代码:https://github.com/yu969890202/ArcEngine/tree/master/WinFrom_ArcEngine_PointDistribution博客后面有两张 ...

  4. ArcEngine创建要素类_线类型

    public ESRI.ArcGIS.Geodatabase.IFeatureClass CreateFeatureClassForLine(ESRI.ArcGIS.Geodatabase.IWork ...

  5. 【225】ArcEngine 实现要素添加 & 删除

    参考:ArcGIS Engine效率探究——要素的添加和删除.属性的读取和更新 删除要素 //添加图层,显示在最上面 axMapControl1.AddShapeFile(@"D:\01-业 ...

  6. ArcEngine获取要素数据集的容差和分辨率

    /// <summary> /// 根据数据集获取容差 /// </summary> /// <param name="dataset">< ...

  7. Java判断一个字符是否是数字的几种方法的代码

    在工作期间,将写内容过程经常用到的一些内容段做个记录,下面内容是关于Java判断一个字符是否是数字的几种方法的内容,希望能对码农们有好处. public class Test{ public stat ...

  8. 使用定时器判断确保某个标签有值才执行方法, 控制js代码执行先后顺序

    使用定时器判断确保某个标签有值才执行方法: var wait = setInterval(function(){ var diqu = $("#diqu").val(); //确保 ...

  9. php中判断字符串是否全是中文或含有中文的实现代码

    <?php header('Content-type:text/html; charset=utf-8'); $str = '你好'; if(preg_match('/^[\x{4e00}-\x ...

随机推荐

  1. Android Studio配置SVN 以及使用代码管理

    一.Android Studio配置SVN Android Studio关联配置SVN非常easy,在Settings里面.找到Version Control->Subversion.在这个页面 ...

  2. 2.5 Legacy APIs官网剖析(博主推荐)

    不多说,直接上干货! 一切来源于官网 http://kafka.apache.org/documentation/ 2.5 Legacy APIs A more limited legacy prod ...

  3. 基于Linux系统的Nagios网络管理模块的实现

    基于Linux 系统的Nagios网络管理模块的实现 1.引言 随着计算机网络的普及,网络管理已成为信息时代中最重要的问题之一.在现有的技术条件下,人们希望有一个更加稳定可靠的网络环境.计算机网络管理 ...

  4. MD5和sha1加密算法--散列加密技术 MD5:128bit的大整数

    在很多电子商务和社区应用中,我们都要存放很多的客户的资料,其中包括了很多的隐私信息和客户不愿被别人看到的信息,当然好有客户执行各种操作的密码,此时就需要对客户的信息进行加密再存储,目前有两种比较好的加 ...

  5. Django快速搭建博客

    准备工作: 1.Python 2.Django 3.Git 安装Python: 官网下载 安装Django: #安装最新版本的Django $ pip install django #或者指定安装版本 ...

  6. 你真的懂Flask中浅谈蓝图Blueprint吗?

    一,什么是Flask中的蓝图Blueprint Blueprint是用于实现Flask框架中单个应用的视图,模板,静态文件的集合. Blueprint 是一个存储操作(路由映射)方法的容器,这些操作在 ...

  7. Spider_reg

    # 解析 数据的分类 结构化数据 有固定的格式,如 :HTML.XML.JSON 非结构化数据 图片.音频.视频,这类数据一般都存储为二进制 # 正则表达式 re 使用流程 创建编译对象:p = re ...

  8. [JWT] JWT with HS256

    The advantages of JWT over traditional session based validation is: it effectively removing all auth ...

  9. 10. Spring Boot JDBC 连接数据库

    转自:https://blog.csdn.net/catoop/article/details/50507516

  10. Weblogic问题汇总

    1. weblogic unable to get file lock问题 在项目使用过程中,非正常结束Weblogic进程导致Weblogic无法启动,出现以下错误: <BEA-141281& ...