Select/Delete Polygons that are surrounded by other Polygons

6228
12
Jump to solution
08-30-2013 10:28 AM
JessicaGormont
New Contributor II
We are trying to convert our Address Annotation Feature Class into a Shapefile. I was able to use the "Feature to Polygon" tool in order to do this conversion, but it filled in all the holes in the numbers with additional polygons (please see attached photo for example). I need to select and delete all these additional polygons as efficiently as possible; since there are over 100k features, it would take WAY too long to do it by hand.

Is there a way to select all the polygons that are completely surrounded by other polygons within the same shapefile?

Additional notes: There are all sorts of font sizes in the Anno, so I can't just select the additional polygons by area. Also, I am not a programmer, so if you give me code, please also tell me how to use it. Thanks!!!
0 Kudos
1 Solution

Accepted Solutions
DarrenWiens2
MVP Honored Contributor
1.) Make a universe polygon (covering all of your annotations)
2.) Erase, or Union-Select-Delete, to get everything not an annotation
3.) Select the polygons in the annotation that touch the boundary of the "not annotation" layer (Select By Location)
4.) Switch the selection
5.) Delete the donut holes

View solution in original post

12 Replies
JimCousins
MVP Regular Contributor
what about 2 copies of the source (different names). Then use the Select by Location tool to select features from PolygonLayer1 source layer PolygonLayer2 and set the spatial selection method to "are completely within the source layer feature". Tinker with the search distance as necessary.
Regards,
Jim
0 Kudos
JessicaGormont
New Contributor II
I tried that method. The problem is that all the polygons, including the numbers, are the exact same shape when you do that. This means that they are all considered "within" the other polygons. So all the polygons get selected, rather than just the additional polys.
0 Kudos
TimWitt
Frequent Contributor
Jessica,

What if you use this on your polygon layer http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000003m000000

Use the buffer tool around those points and then use the select by location, wherein the buffer polygon is completely within the other polygon.

Since you want to get rid of mostly "round" polygons, most of your buffers should be within (you need to play around with the buffer distance) the "round" polygons, while the other buffers should cut your numbers and not be selected.

Hope this wasn't too confusing.

Tim
0 Kudos
JessicaGormont
New Contributor II
It wasn't too confusing. 🙂 And I thought it might work for a few minutes. However, since some of the addresses are font size 1 and others are as big as font size 9, there is no "one size fits all" buffer that will work on all the points. Also, when I converted the addresses over from annotation, they lost all their attributes, so I have no way to select them by font size to work on them as groups.
0 Kudos
JakeSkinner
Esri Esteemed Contributor
Can you upload a small sample of the data?
0 Kudos
RichardFairhurst
MVP Honored Contributor
It wasn't too confusing. 🙂 And I thought it might work for a few minutes. However, since some of the addresses are font size 1 and others are as big as font size 9, there is no "one size fits all" buffer that will work on all the points. Also, when I converted the addresses over from annotation, they lost all their attributes, so I have no way to select them by font size to work on them as groups.


On the Polygon features add a double field called Parts.  Calculate it using Python in the Field Calculator to be:

!Shape.PartCount!

Shapes that enclose other shapes should have counts of 2 or more.  Doughnut holes should have counts of 1 (as well as the numbers 1, 2, 3, 5, and 7).  Select all of the features that have Part > 1.  Then Select by Location on the layer itself using the feature selection with a very small buffer distance and the Intersect option.  Now use the Select from Current Selection option of the Select by Attributes dialog to select Parts = 1  These should be all of the doughnut holes, but it could also include numbers from different labels that overlapped at map book boundaries or which were tightly packed together so that adjacent numbers touched.

Reverse the selection and export that set of features to a new feature class (a non-destructive way of getting rid of the suspected doughnut holes, so you have the original to use for recovery of the kinds of overlaps that should not have been deleted).  Review the results and restore any touched real text that should not have been deleted.

You can use the original feature class with a different symbol color on the removed shapes, and also use a definition query of PARTS = 1 to only show single part features.  Overlay that layer with the exported text.  That should help you spot real text values that were accidentally removed due to the way they were touched by multipart numbers.
0 Kudos
JessicaGormont
New Contributor II
Sure. Here's a shapefile with a decent sample of the polygons. Thanks!
0 Kudos
RichardFairhurst
MVP Honored Contributor
The perimeter to area ratio should also be used to help separate circular shapes from non-circular shapes.  I forget the ratio of a perfect circle but a little experimentation with a few circular examples should come up with the ratio fairly easily.
0 Kudos
DarrenWiens2
MVP Honored Contributor
1.) Make a universe polygon (covering all of your annotations)
2.) Erase, or Union-Select-Delete, to get everything not an annotation
3.) Select the polygons in the annotation that touch the boundary of the "not annotation" layer (Select By Location)
4.) Switch the selection
5.) Delete the donut holes