Uses terra::focal to apply a post-classification based on a spatial moving window.

postclass(pred, w, fun = "modal", ...)

Arguments

pred

A SpatRaster object corresponding to the prediction

w

The window can be defined as one (for a square) or two numbers (row, col); or with an odd-sized weights matrix. See link{terra}[focal].

fun

function that takes multiple numbers, and returns a single number. For example mean, modal, min or max. It should also accept a na.rm argument, either as actual argument or through use of ... See link{terra}[focal].

...

Additional parameters used by See link{terra}[focal].

Value

A SpatRaster object.

Author

Darius Görgen (MapTailor Geospatial Consulting GbR) info@maptailor.net
Maintainer: MAPME-Initiative contact@mapme-initiative.org
Contact Person: Dr. Johannes Schielein
Copyright: MAPME-Initiative
License: GPL-3