Description Usage Arguments Details Value Author(s) See Also Examples
applies several filter functions on single RasterLayer.
1 | filter_Rst(rst, fLS = "all", sizes, NArm = TRUE)
|
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. |
"sum" - sum of all cells in a MovingWindow
"min" - minimum value of all cells in a MovingWindow
"max" - maximum value of all cells in a MovingWindow
"mean"- mean value of all cells in a MovingWindow
"sd" - standard deviation of all cells in a MovingWindow
"modal" - most frequent value of all cells in a MovingWindow
"sobel" - sobel edge detection filter in horizontal and vertical directions
"sobel_hrzt" - sobel edge detection filter in horizontal direction only
"sobel_vert" - sobel edge detection filter in vertical direction only
returns a RasterStack with the desired filtered artificial layers.
Andreas Schönberg
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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.