zoukankan      html  css  js  c++  java
  • ArcEngine组合选中相邻图形

    1、获取选中图形:ISelectionSet pSelSet = (pFeaLyr as IFeatureSelection).SelectionSet;

            pSelSet.Search(null, false, out pCursor);
                                  IFeatureCursor pFeaCursor = pCursor as IFeatureCursor;

    2、利用Union工具组合所有图形

                IGeometryBag pGeoBag = new GeometryBagClass();
                IGeometryCollection pGeoCol = pGeoBag as IGeometryCollection;

    3、判断是否为外环图形:

                        IPolygon pGeoPolygon = pGeometry as IPolygon;
                        int iExRingsCnt = pGeoPolygon.ExteriorRingCount;
                        if (iExRingsCnt > 0)

    4、将组合图形转换为:IGeometryBag pExRings = (pGeometry as IPolygon4).ConnectedComponentBag;

    IGeometryBag 继承与IGeometry

    5、IGeometry pGeoNew = (pExRings as IGeometryCollection).get_Geometry(i);获取就可以了。两个相邻的就成一个了。

  • 相关阅读:
    [bzoj3123] [Sdoi2013]森林
    [bzoj2173] 整数的lqp拆分
    Linux
    使用高德地图API
    EF具体用在什么类型的项目上
    出现Data Tools 与VS 不兼容问题
    Entity FramWork
    Entity
    Entity
    BASH
  • 原文地址:https://www.cnblogs.com/dengshiwei/p/4258658.html
Copyright © 2011-2022 走看看