zoukankan      html  css  js  c++  java
  • 合并一个图层选择对象C# arcengine

    ArcEngine实现Merge功能

        private IGeometry GetGeo(IFeatureLayer pFlyr)
            {
                IEnumGeometry pGeos = new EnumFeatureGeometryClass();
                IEnumGeometryBind pGeosBind = pGeos as IEnumGeometryBind;
                IFeatureSelection pflyrSelection = pFlyr as IFeatureSelection;
                pflyrSelection.SelectFeatures(null, esriSelectionResultEnum.esriSelectionResultNew, false);            pGeosBind.BindGeometrySource(null, pflyrSelection.SelectionSet);
                pGeos.Reset();
                IPolygon sPoly = new PolygonClass();
                ITopologicalOperator pTopo = sPoly as ITopologicalOperator;
                pTopo.ConstructUnion(pGeos);
                pTopo.Simplify();
                sPoly = pTopo as IPolygon;
                pflyrSelection.Clear();
                return sPoly;
            }

         执行上面的代码段可以把图层上的所有实体合并。注意红色部分的那行代码,不写此行代码,pGeos 里的图形个数为0,最后得到的spoly是空。

    来自:http://program.ntwtsp.com/aspnet/18234.htm
  • 相关阅读:
    tomcat进阶操作
    tomcat环境部署
    CentOS 7.2安装lepus数据库监控系统
    常见的Linux系统监控命令
    zabbix使用jmx监控tomcat
    zabbix配置文件详解
    zabbix2.2.22 升级3.0.18
    zabbix日志监控
    zabbix api的使用
    zabbix低级自动发现之mysql多实例
  • 原文地址:https://www.cnblogs.com/gisoracle/p/2420845.html
Copyright © 2011-2022 走看看