mask_artifacts: Mask artifacts

Description Usage Arguments Details Value References Examples

View source: R/mask_artifacts.R

Description

Mask artifacts

Usage

1
mask_artifacts(x, kernel_sizes = 5, times_sd = 3)

Arguments

x

linkS4class{RasterLayer}

kernel_sizes

numeric. Size of the kernels, could be one or more. See details.

times_sd

numeric. Thresold value. See details.

Details

Is a faster approach that I pick up from Hengl and Reuter (2009). The algorithm compute the average elevation with a kernel and compute the difference between the average elevation and the elevation at the core cell. A threshold is used to classify this difference.

If users uses several kernels, the masks are aggregated.

Value

x linkS4class{RasterLayer}. Binary image.

References

Hengl, T., Reuter, H.I., 2009. GEOMORPHOMETRY Concepts, Software, Applications, Developmen. ed. Elsevier, Amsterdam. (p. 100)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
r <- raster(ncol = 200, nrow = 100)
projection(r) <- NA
extent(r) <- extent(0, 200, 0, 100)

set.seed(11)
dem <- fake_dem(r, n_random_data = ncell(r) * 0.01, z_range = c(0, 500))

mask_artifacts(m)

plot(m)

GastonMauroDiaz/rdemtools documentation built on Oct. 22, 2019, 8:32 p.m.