LossCalc | R Documentation |
Calculation of the area where forest loss occured in a tree cover time series. It uses information on the occurence of forest loss and a forest mask to focus the analysis to pixles where lost occured. The area is then summed up for every polygon specified in the studysite object.
LossCalc( inputForestMap = NULL, inputLossMap = NULL, studysite = NULL, latlon = NULL, polyName = NULL, ncores = 1, saveCSV = FALSE, years = 2001:2018 )
inputForestMap |
A |
inputLossMap |
A |
studysite |
An object of type |
latlon |
|
polyName |
|
ncores |
The number of cores to use, i.e. at most how many child processes will be run simultaneously. |
saveCSV |
Default is |
years |
A vector of type |
The studysite object with it's attribute table being ammended by the
results of the calculation. Additionally, a csv file containing the polyName
attribute as well as the results of the calculation can be saved to disk.
This function relies heavily on parallization, indicating the importance of both, a high number of CPUs and large enough RAM.
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
library(sf) library(raster) library(mapme.forest) aoi = st_read(system.file("extdata", "aoi_polys.gpkg", package = "mapme.forest")) yearlyRaster = stack(system.file("extdata", "pkgTest_yearlyCover.tif", package = "mapme.forest")) lossYear = raster(system.file("extdata", "pkgTest_lossyear.tif", package = "mapme.forest")) result = LossCalc(inputForestMap = yearlyRaster, inputLossMap = lossYear, studysite = aoi[1,], latlon = TRUE, polyName = "id", ncores = 1, saveCSV = FALSE, years = 2000:2018) str(result)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.