Select to view content in your preferred language

how to find that two polygon boundaries are connected?

4560
6
03-09-2015 12:22 PM
waqarahmad
Deactivated User

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
Deactivated User

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
Deactivated User

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
Occasional Contributor

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.