How can I get rid of small spots of other classes within a class?

1188
5
06-29-2017 09:45 AM
PhilippSzczecina
New Contributor II

I want to the really small spots of the orange-colored class to be removed or take the color of their neighbour grid Points (yellow) and vice versa. Already tried the shrink tool and several other ones, but can not quite figure out how to do this ?

0 Kudos
5 Replies
BlakeTerhune
MVP Regular Contributor

You posted in the GeoNet Help community but it should probably be in Managing Data‌ or https://community.esri.com/community/gis/analysis/spatial-analyst?sr=search&searchId=c6738220-e61e-4...

0 Kudos
DanPatterson_Retired
MVP Emeritus

RegionGroup ... select by attributes the zones of a certain size that you want to remove (ie zones less than 100m^2, which might equal 10 cell of 10m*10m cell size) Then

Nibble ... (how nibble works ...)

To fill in the zones from the surrounding values, is one method

If the 'zones' that you wanted to remove were smaller, then a filter would work.  You can't select just those small orange zones since you need to convert them to discrete entities,l which is what regiongroup does.  The selection by a certain size, allows you to convert those to your null mask from which you then nibble in the surrounding values into the void.

curtvprice
MVP Esteemed Contributor

Zonal Geometry can be used to measure region area in map units. For example, this expression will set all regions < 1km2 (if xy units are meters) to NoData, all other cells to 1:

Here are some raster calculator expressions. 

SetNull(
    ZonalGeometry(RegionGroup("in_raster", "EIGHT"), "VALUE",  "AREA") < 1e6,
    1)

Let's call the output "mask_raster".  Then, the NoData areas in the mask raster are used to tell Nibble what to nibble:

Nibble("in_raster", "mask_raster")‍‍‍

Nibble—Help | ArcGIS Desktop 

JayantaPoddar
MVP Esteemed Contributor

You could also check Eliminate—Help | ArcGIS for Desktop 



Think Location
DanPatterson_Retired
MVP Emeritus

Jayanta... Eliminate would require converting from raster to vector, then using multipart to singlepart, then eliminate then back to raster, and an Advanced licence... doable