prepTC: Pre-Processing of tree cover layers

View source: R/preprocess.R

prepTCR Documentation

Pre-Processing of tree cover layers

Description

Calculates a binary tree cover mask for a baseline year.

Usage

prepTC(inputForestMap, thresholdCover = NULL, thresholdClump = NULL)

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(s)

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


mapme-initiative/mapme.forest documentation built on April 15, 2022, 4:50 a.m.