We have a raster image with 9 discrete values. Generated the image using SAGA's Terrain Analysis -> Morphometry -> TPI classification technique. Now, like to merge pixels which occupy certain area (say less than 1 sq km) to the nearest maximum value. Eg, in the image - like to merge the white encircled ones to the nearest maximum value - 5 (Violet).
Because, if i try to vectorize this image, it takes too much time (and not getting finished) to convert those pixels into polygons as there are so many polygons with less than 1 sq km. Our aim is to get a vector file from the classified raster.
Is there any workaround like, split the raster into four and then do the same raster -> vector conversion ? But still, it will have too many polygons to deal with i guess