detct_RstHmgy: Detect Raster Homogeneity

Description Usage Arguments Details Value Note Author(s) Examples

View source: R/detct_RstHmgy.R

Description

detects homogeneity of Rasterlayers in a RasterStack and drops RasterLayers with homogeneity higher than a set Threshold Value.

Usage

1
detct_RstHmgy(Stk, valueRange, THvalue)

Arguments

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.

Details

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.

Value

Returns the RasterStack without homogeneous RasterLayers.

Note

Author(s)

Andreas Schönberg

Examples

 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)

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