Help creating a query expression to select pixels by size and distance from other pixels?

411
1
09-11-2017 09:39 AM
Labels (1)
AlexanderArkowitz
New Contributor

Hello all,

I am attempting to create a land cover ID map from some imagery. My current goal is to create an expression or method that selects all "isolated" single 1X1 pixels of a certain land cover type so I can then later change them. While understand I can select all 1x1 pixels using the calculate geometry then select by area < XXX, I want to only select isolated pixels that are ALSO over a certain distance from similarly identified values.

In short I would like to select land cover made up of 1 or 2 pixels (not in a large group) and then only select the ones that are over a certain distance of buffer zone of the same type of land cover. I could then delete/change these pixels to have a "cleaner" map.

Any help would be appreciated!

Alex

https://community.esri.com/community/gis/managing-data?sr=search&searchId=50591c1c-007b-42c6-be01-54...

0 Kudos
1 Reply
DarrenWiens2
MVP Honored Contributor

You should first decide if you want to do this in raster (pixels) or vector (polygons). I'd suggest raster, and here's basically how I think you can do it.

For each landcover class:

1.) run Region Group to group adjacent, similar pixels into individual blobs

2.) if the blob is 1-2 pixels in size, consider it a small blob. If not, consider it a large blob.

3.) run Euclidean Distance from the large blobs

4.) overlay the Euclidean Distance raster with the small blobs. If they're over some distance, flag for delete. If not, ignore.

5.) use the pixels to delete as the mask for Nibble to fill in the holes (I think this is the tool, but perhaps not)

Everywhere I say 'if' above means you should use a Con statement.