how to find that two polygon boundaries are connected?

4230
6
03-09-2015 12:22 PM
waqarahmad
New Contributor III

I am working on a Geo database where there is a layer with many polygons. i want to find that which polygons boundaries are connected so that i can create new layer from that polygons and which polygon boundary is not connected with first polygon, like there is space between them, so i want to not include that polygon in layer. This process will be achieved through python programming

I am using python in Arcgis 10.2.

0 Kudos
6 Replies
XanderBakker
Esri Esteemed Contributor

The polygon class in arcpy has a method called touch that will yield the geometry of the common boundary: ArcGIS Help (10.2, 10.2.1, and 10.2.2) . I guess you could use that.

waqarahmad
New Contributor III

This looks good. I will try this Tomorrow.. and will get to you . Thanks for your replay

0 Kudos
DarrenWiens2
MVP Honored Contributor

Could you provide a picture of what you'd like the result to be? Many output feature classes or one feature class? Can you accomplish the desired result using Select By Location, using Intersect selection method?

0 Kudos
waqarahmad
New Contributor III

I want a result that , if two or more polygons are connecting to each other, then they would be one feature class

0 Kudos
yosukekimura
New Contributor III

I would use Generate Near Table ArcGIS Help (10.2, 10.2.1, and 10.2.2)  with search_radius = 0 to make table of features that are touching.  then select from the layer which is included in the near table's "IN_FID" field.  These are the feature which touches at least one neighbor.  Not clear if you want them to get dissolved.  Do so if you want to ArcGIS Help (10.2, 10.2.1, and 10.2.2) .  The rest of features are the lone features.  Save each of them by Copy Features tool ArcGIS Help (10.2, 10.2.1, and 10.2.2)  .

XanderBakker
Esri Esteemed Contributor

Based on what yosuke kimura​ suggested, you could dissolve the polygons (without creating multi parts). This will yield a new featureclass in which each feature includes those polygons that touch (or overlap). Loop through this featureclass and select the features from the original featureclass and write the selection to a new featureclass.