0

Summary of the process I am trying to achieve and optional missing step (within brackets): class raster -> [ patches for class i -> masking small patches for class i ] -> converting to polygons for class i -> statistic computation in a second raster for each polygon -> overall statistics

I am currently working with a climatic classification map than span all the world at 1-km resolution (huge amount of pixels). For each selected class, I convert the raster map to individual polygons (huge amount of polygons) in order to extracts statistics in these areas from other data layers. I want to add a filtering step before the conversion to vector, so at the raster level, for 2 reasons:

  • the classification confidence for small patches is generally not good enough (I can't rely on that to filter out),
  • there could me too many small patches for some classes so I'd like to avoid them to avoid memory usage limit error, assuming that removing them won't alter to much my statistics, or alter it positively.

I have found a few forum answers about using connectedComponents, connectedPixelCount, focalMode, etc. I have tried those solutions, and this is not what I need: I don't want to filter these area for a visual effect, so I don't want it to be zoom-level-dependent, based on "screen pixels". Similarly however, I want to know, at the raster stage, how big my patches are as a number of pixel connections (real pixels, the one of the image).

Does anyone has an idea about how to achieve that?

0 Answers0