
Pre-Processing of tree cover layers
prepTC.Rd
Calculates a binary tree cover mask for a baseline year.
Arguments
- inputForestMap
A RasterLayer representing forest cover. For the primary use-case of this function tree cover is expected as values in the range [0,100] representing percentage and is used when the user wants to obtain a binary tree cover map.
- thresholdCover
A numeric vector of length one in the range of [0,100]. It is used as the definition criterium for forest areas in datasets like Hansen (2013), where a pixel's values indicates the percentage of coverage with trees. Any pixel below this threshold will get the value 0, any pixel above will get the value 1.
- thresholdClump
A numeric of length one indicating the number of pixels which are classified as a clump. Any number of pixels smaller than this threshold will be classified to NA.
Value
A RasterLayer object with binary values when thresholdCover
was
specified and with raster cell clumps removed in case thresholdClump
was
specified. Either one of the parameters can be specified on its own.
Author
Darius Görgen (MapTailor Geospatial Consulting GbR) info@maptailor.net
Maintainer: MAPME-Initiative contact@mapme-initiative.org
Contact Person: Dr. Johannes Schielein
Copyright: MAPME-Initiative
License: GPL-3
Examples
library(raster)
library(mapme.forest)
treeCover = raster(system.file("extdata", "pkgTest_treecover2000.tif",
package = "mapme.forest"))
binaryCover = prepTC(inputForestMap = treeCover,
thresholdCover = 75,
thresholdClump = 25)
binaryCover
#> class : RasterLayer
#> dimensions : 453, 643, 291279 (nrow, ncol, ncell)
#> resolution : 0.00025, 0.00025 (x, y)
#> extent : 107.119, 107.2798, 16.58075, 16.694 (xmin, xmax, ymin, ymax)
#> crs : +proj=longlat +datum=WGS84 +no_defs
#> source : memory
#> names : pkgTest_treecover2000
#> values : 0, 1 (min, max)
#>