杨千羽的学习历程

倚天照海花无数,流水山高心自知

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是空。

阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/u013084746/article/details/77971277
文章标签: AE
个人分类: AE
上一篇ArcGIS Engine效率探究——要素的添加和删除、属性的读取和更新
下一篇ArcEngine创建要素类_线图层
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭