Description Usage Arguments Details Value Note Author(s) Examples
View source: R/detct_RstHmgy.R
detects homogeneity of Rasterlayers in a RasterStack and drops RasterLayers with homogeneity higher than a set Threshold Value.
1 | detct_RstHmgy(Stk, valueRange, THvalue)
|
Stk |
a RasterStack |
valueRange |
numeric - in percent (0.x) Range of Values with most data (see details). |
THvalue |
numeric - in percent (0.x) Threshold Value for homogeneity Value to drop Layers. |
This function is used to test a RasterStack for homogeneous RasterLayers.A RasterLayer is makred as homogenious if >= x% of the data is distributed in y % of the value range. E.G. If 90% (THvalue=0.9) of the Raster cells have values within 10% of the value range (valueRange=0.1) the RasterLayer is dropped if due to homogeneity.
Returns the RasterStack without homogeneous RasterLayers.
To perform the test for homogeneity the data is cleand from INF and NA values. Further the data will be normalized to set 100 breaks representing 1% of the data range.
The RasterLayers in the output Stack will be selected by their homogeneity and are NOT manipulated (not clean from INF or NA or normalized)
Andreas Schönberg
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ### load data
extpath <-system.file("extdata","lau_mspec.tif",package = "LEGION")
mspec <- raster::stack(extpath)
names(mspec)<- c("blue","green","red","nir")
### compute all vegetation indices
x <-LEGION::vegInd_RGB(mspec,3,2,1)
plot(x)
### homogenity if 90% of data represent 10% of the data range
hmgy90 <-detct_RstHmgy (x,THvalue=0.9,valueRange=0.1)
hmgy90
### homogenity if 70% of data represent 10% of the data range
hmgy90 <-detct_RstHmgy (x,THvalue=0.9,valueRange=0.1)
### homogenity if 70% of data represent 5% of the data range
hmgy90 <-detct_RstHmgy (x,THvalue=0.9,valueRange=0.1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.