Combine and select raster pixels

503
2
09-14-2022 11:27 PM
MathildePaustian
New Contributor II

Hello

 

I have a problem which I have not found a solution on my own. 

I have a raster data layer (as shown below) where I want to keep all the pixels that are adjacent and grouped with at least 20 pixels. I don't care about the pixels value as I have already selected all the pixels with the values I want. 

I also want to keep each pixels information and not combine them into a single pixel or polygon with a summed value. 

MathildePaustian_0-1663222750665.png

 

Below is the result I want to end up with. I want to be able to run multiple analysis to change the variable of the lowest common denominator of how many pixels should be present in the group e.g. 20 or 30. 

MathildePaustian_1-1663223012506.png

The above result was made my one of my colleagues by coding in Python. I cannot code and therefore is looking for an option within ArcGIS Pro or QGIS. 

 

I hope this is understandable. 

 

0 Kudos
2 Replies
JohannesBierer
Occasional Contributor III

I think for the first part of your question I would convert the raster to polygon, add a dissolve field with one value, do a dissolve on the polygons and then do a multipart to singlepart to be able to select the wanted group size of the polygons. This polygon feature class I would further use to "select/mask" all the wanted cells of the raster data or to use as input in the zonal statistic tool for the second part of your question?

https://pro.arcgis.com/de/pro-app/2.8/tool-reference/spatial-analyst/extract-by-mask.htm

https://pro.arcgis.com/de/pro-app/2.8/tool-reference/spatial-analyst/zonal-statistics.htm

But the second part of your question I didn't really understand  ...

0 Kudos
JohnWatt
Occasional Contributor

Hi Mathilde.  It looks like you're wanting to interpolate values for a larger area, using sample values in another raster.  There is a Raster Function called Interpolate Irregular Data (Analysis menu, Raster Functions dropdown).  You might need to convert your input raster to points (raster to point), but you can then alter the interpolation method and search radius, and get a fast result to check against your expected output.

 

JohnWatt_0-1663300700042.png

 

 

0 Kudos