getTM: Get yearly binary tree cover maps

View source: R/preprocess.R

getTMR Documentation

Get yearly binary tree cover maps

Description

This function calculates yearly tree cover maps based on a starting year layer in a binary forest mask form and an loss year layer which indicates which pixels were subject to forest loss in a given year,

Usage

getTM(inputForestMap, inputLossMap, years = 2000:2018)

Arguments

inputForestMap

A RasterLayer with a binary mask of forest cover (with 0 representing no forest; 1 representing forest) for the starting year.

inputLossMap

A RasterLayer in which the cell values represent the year in which forest loss occured during the time series represented in the years object.

years

A numeric vector indicating the years represented in the values of the inputLossMap object. 0 is expected to indicate no loss at all, a value of 1 corresponds to the first value in years, a value of 2 to the second, and so on.

Value

A binary RasterStack with a number of layers equal to length(years). A value of 0 represents no forest cover, a value of 1 represents forest cover. All cell values indicating forest loss in the inputLossMap object at a given year will be consectuivley set to 0. The result is a yearly binary classification of forest cover.

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)

binaryCover = raster(system.file("extdata", "pkgTest_binaryCover.tif",
                                 package = "mapme.forest"))
lossYear = raster(system.file("extdata", "pkgTest_lossyear.tif",
                              package = "mapme.forest"))
yearlyMaps = getTM(inputForestMap = binaryCover,
                   inputLossMap = lossYear,
                   years = 2001:2018)
yearlyMaps


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