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);获取就可以了。两个相邻的就成一个了。

  • 相关阅读:
    UML建模之用例图关系
    python模块介绍
    Delphi操作XML(七)
    Delphi操作XML(一)
    Delphi操作XML(五)
    Delphi操作XML(六)
    Delphi操作XML(二)
    Delphi操作XML(四)
    Delphi操作XML(三)
    决心好好写cnblogs
  • 原文地址:https://www.cnblogs.com/dengshiwei/p/4258658.html
Copyright © 2011-2022 走看看