Skip to main content
1 of 2

How to create holes from overlap polygon in Arcobjects C#?

I have a polygon layer it contain some overlap polygons.enter image description here

I want Holes instead of overlap polygons.

i tried some code

                  ESRI.ArcGIS.ArcMapUI.IMxDocument mxd = ArcMap.Application.Document 
         as ESRI.ArcGIS.ArcMapUI.IMxDocument;
            if (mxd.SelectedItem is ESRI.ArcGIS.Carto.IFeatureLayer)
            {
                ESRI.ArcGIS.Carto.IFeatureLayer flay = mxd.SelectedItem as ESRI.ArcGIS.Carto.IFeatureLayer;
                ESRI.ArcGIS.Geodatabase.IFeatureClass fcls = flay.FeatureClass;
                ESRI.ArcGIS.Geodatabase.ISpatialFilter spatialFilter = new ESRI.ArcGIS.Geodatabase.SpatialFilterClass();

                spatialFilter.SpatialRel = ESRI.ArcGIS.Geodatabase.esriSpatialRelEnum.esriSpatialRelOverlaps;
                ESRI.ArcGIS.Geodatabase.IFeatureCursor fcur = flay.Search(spatialFilter, true);
                ESRI.ArcGIS.Geodatabase.IFeature fea = fcur.NextFeature();
                while (fea!=null)
                {
                    ESRI.ArcGIS.Geometry.IGeometry geo= fea.Shape;
                    ESRI.ArcGIS.Geometry.IGeometryCollection gcoll = geo as ESRI.ArcGIS.Geometry.IGeometryCollection;
                   
                    fea = fcur.NextFeature();
                }

further no Idea. Please give me suggestions.

thanks.