Skip to main content
deleted 42 characters in body; edited tags; edited title; edited title
Source Link
PolyGeo
  • 65.4k
  • 29
  • 114
  • 345

How to create Creating holes from overlap polygonoverlapping polygons in ArcobjectsArcObjects and C#?

I have a polygon layer it containwhich contains some overlapoverlapping polygons. 

enter image description here

I want Holes instead of overlapoverlapping 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.How can I do this?

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.

Creating holes from overlapping polygons in ArcObjects and C#?

I have a polygon layer which contains some overlapping polygons. 

enter image description here

I want Holes instead of overlapping 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();
                }

How can I do this?

Source Link

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.