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 input raster data is rounded to integers.
Arguments
- x
SpatRaster, single layer with elevation values. Values should have the same unit as the map units
- 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