Arcpy solution for selecting polygons of certain size and merging with larges surrounding polygon

880
4
02-24-2017 05:11 PM
MikeEichorn
New Contributor

Hello, I am working on a school project where I have taken a 10m DEM, derived aspect, reclassified, and converted to polygons (9 classes in a Gridcode field). I now need to select areas less than 1.0 acre in size (i can currently do this using python), and then merge these selected polygons with either the polygon surrounding or adjacent to. This is the step i am struggling with a script for. any direction wouold be greatly appreciated. Basically i need to remove polygons less than one acre and merge them in with the larger surrounding polygon. #arcpy #python

0 Kudos
4 Replies
JoshuaBixby
MVP Esteemed Contributor

The name might not be intuitive, but what you want is the Eliminate tool.  You can merge with neighboring polygons based on area or length of shared border.  The Eliminate tool does require an advanced license, though.

0 Kudos
MikeEichorn
New Contributor

Thanks Joshua, i will give it a go.

0 Kudos
NeilAyres
MVP Frequent Contributor

And while it was still in raster form you could have done some cleaning with the SA/Generalisation toolbox.

An overview of the Generalization toolset—Help | ArcGIS Desktop 

DanPatterson_Retired
MVP Esteemed Contributor

As Neil points out, this process can be accomplished using Regiongroup, a query to select all zones that are less than your threshold size, set those to null, then use Nibble to fill in the void using values from the surrounding zones in a more-or-less equal fashion  The specific link within Neil's link is here (... generalizing-zones-with-nibble ...)