Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a trick for removing the donut holes, which is converting the polygon to line and then creating polygon out of the lines and in the end merging all of them. The drawback of this strategy is that in removes other holes and empty areas which in reality are empty and should be kept empty. See below image:

enter image description here

Any thoughts/ideas would be appreciated.

share|improve this question
What software and version are you using? –  PolyGeo Jul 15 '13 at 4:02
I am using Arcmap 10.0 –  Arash Jul 15 '13 at 4:15
I cannot picture what you are meaning by "removing the donut holes" and "removes other holes and empty areas which in reality are empty and should be kept empty". Can you edit your question to include a diagram, please? –  PolyGeo Jul 15 '13 at 4:32
I've voted to keep this question open because I believe the OP is trying to remove some but not all donuts. He's looking for a way to keep some of them. –  Fezter Jul 15 '13 at 4:42
Very similar to How to remove small “salt & pepper” polygons from a layer?, but using a QGIS process. You could probably work with very similar processes in ArcGIS. –  RyanDalton Apr 22 '14 at 18:18

4 Answers 4

up vote 9 down vote accepted

I would try the Union tool with NO_GAPS:

NO_GAPS —A feature will be created for the areas in the output that are completely enclosed by polygons. This feature will have blank attributes.

You can then select the features with blank attributes below a threshold size and calculate their attributes to be the same as the original polygon - or copy/paste them in the Editor's Attribute window.

From there the Dissolve tool should complete the job.

share|improve this answer
Thank you! I would say that you made a very good suggestion! –  Arash Jul 15 '13 at 15:43

PolyGeo's solution is one I have employed myself and works well (+1). Another alternative is to buffer your polygons by a small amount and then de-buffer the result by the same amount (say +1m and then -1m). This also works well but carries a small risk of accidentally joining polygons that neighbour by the same amount as your buffer. It can also increase your vertex count (which may or may not be a problem).

You could also write a script for a robust solution by iterating over each polygon, creating temporary polygons based on the interior rings and testing these for their areas. If they are below your threshold, you then remove that interior ring from the geometry and update your row. This solution is more work than PolyGeo's solution or my buffer hack above but is possibly a "purer" approach.

share|improve this answer
Thanks! I have never tried PolyGeo's solution. I'd appreciate if you let me know how I can try that. –  Arash Jul 15 '13 at 15:44
The method is described in the other answer to your original question –  MappaGnosis Jul 16 '13 at 7:13

Here's another way to remove lakes from polygons (like the zip code map layer from Navteq). This is also useful to clean up territory map layers that have been generated by dissolving the zip code map layer by the territory code.

  1. Use a Geoprocessing "Union" on the polygon map layer and remove the checkbox for “Gaps Allowed” (which is checked by default.) This creates polygons for all of the "donut" holes in the polygons.
  2. In the resulting Union map layer, add fields for ID, X, and Y. The ID should be separate from the name/ID of the polygons that have the donut holes that you want to remove.
  3. In the attribute table, use the Field Calculator to calculate the ID from the ObjectID field and use "Calculate Geometry" to fill in the X and Y values.
  4. Separate the donut polygons from the other polygons by selecting (Select by Attributes) those where the name field is null.
  5. Export the selected records to a new table. (table options dropdown-->Export...)
  6. Use the "Add XY" option to create an event layer. (right click layer-->Display XY Data....
  7. Export the event layer to a new feature class. (right click the layer-->Data-->Export data)
  8. Do a spatial join between the new point layer and the ORIGINAL polygon map layer that does not have the donut polygons. Use the “closest” option so that the name of the surrounding polygon gets appended to the attribute table of the donut polygons.
  9. Use a standard table join between the joined point layer and the resulting map layer from the Union (based on the ID field). (right click layer-->Joins and Relates-->Join-->Join data from another layer based on spatial location)
  10. Use the Field Calculator in the attribute table to calculate the null polygon names from the joined point layer.
  11. Run a Geoprocessing "Dissolve" based on the polygon name to merge the donut polygons with the larger named polygon.

Note that this will not correct the problem of the rivers that are cut into the outline of the polygon, but it does improve the original map layer by removing the inner donut holes.

share|improve this answer

You can use "Eliminate Polygon Part" tool (Data Management Tools -> Generalization) in ArcToolbox. You can specify minimum hole area/percentage to remove.

share|improve this answer
This function requires Advanced/ArcInfo license level though. –  Martin Apr 22 '14 at 11:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.