Monday, February 18, 2013

Getting rid of donut holes

I recently had a student ask about getting rid of small holes in her data. She had created a polygon feature class from a raster analysis. Some of you may have seen this happen when working with classified data or sliced data. Or, you may have other donuts made by lakes, river corridors, rights-of-ways, etc.

There are at least two ways to attack this challenge.

Method 1: If you have many (hundreds or thousands), you may want to try the Eliminate Polygon Part tool (which is only available with Advanced ArcGIS). I ran a number of tests and wasn't fully satisfied by the AREA condition of the tool, but I did like the PERCENT option. Let's look at that.

Here's my test data:
The big box with it's smaller square on the left is one multi-part polygon. The box on the right is another polygon.
Here's how I applied the tool:


Notice how I am overwriting the output (since I tested this a bunch) and that I'm using the Optional Condition PERCENT set at 5%. The result:


Here's some other results from just changing the percent amount to 6% and 8%. 



The optional condition of AREA never worked no matter what size I set it at. Is it a bug? I'm not sure. More testing is necessary. Anyone out there had success with AREA?

Method 2: If you have a few to do, you can perform this with an edit. Starting with the same test data, you can do this.

Step 1: Start editing
Step 2: Double-click the donut feature (not the hole). 
Your cursor now turns white outlined in black.

Step 3: Point at the edge of the hole you wish to delete, right-click and choose Part > Delete.

Result is below:
So there you are... Experiment and have fun!



No comments:

Post a Comment