Sieve filter
sieve.Rd
Apply a sieve filter. That is, remove "noise", by changing small clumps of cells with a value that is different from the surrounding cells, to the value of the largest neighboring clump.
Note that the numerical input values are truncated to integers.
Arguments
- x
SpatRaster, single layer with integer or categorical values
- threshold
positive integer. Only clumps smaller than this threshold will be removed
- directions
numeric to indicate which cells are connected. Either
4
to only consider the horizontal and vertical neighbors ("rook"), or8
to consider the vertical, horizontal and diagonal neighbors- filename
character. Output filename
- ...
Options for writing files as in
writeRaster