filter_Rst: Filter Single-band RasterLayer

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/filter_Rst.R

Description

applies several filter functions on single RasterLayer.

Usage

1
filter_Rst(rst, fLS = "all", sizes, NArm = TRUE)

Arguments

rst

a single-band RasterLayer.

fLS

comma-separated character combinations of the desired filter functions. Select from "sum","min","max","sd","mean","modal","sobel","sobel_hrzt","sobel_vert". default = all; (see details).

sizes

numeric - a single value or combinations for the MovingWindow, number must be odd.

NArm

boolean - removes NA values, default= TRUE.

Details

available filter functions

Value

returns a RasterStack with the desired filtered artificial layers.

Author(s)

Andreas Schönberg

See Also

focal

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
### load data
extpath <-system.file("extdata","lau_mspec.tif",package = "LEGION")
mspec <- raster::stack(extpath)
names(mspec)<- c("blue","green","red","nir")
### seperate single raster layer
rst <- mspec$nir
### compute all filter
x <- filter_Rst(rst,sizes=c(3,5,7))
plot(x[[3]])
### compute specific filters
flist <- c("modal","sobel_vert","mean")
y <- filter_Rst(rst,fLS=flist,sizes=c(3,5,7))

SchoenbergA/LEGION documentation built on Jan. 31, 2021, 10:12 a.m.