AreaCalc | R Documentation |
Calculates the changes in forest area based on a rasterObject
forest
mask and a SpatialPolygonsDataFrame
containing areas of interest.
AreaCalc( inputForestMap = NULL, studysite = NULL, latlon = NULL, polyName = NULL, ncores = 1, saveCSV = FALSE, years = 2001:2018 )
inputForestMap |
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 its data frame appended columnwise
for every single entry in the years
object representing the total area
of forest in a given layer of the inputForestMap
object.
If latlon=TRUE
the returned area is in km², otherwise in the
squared unit of the input projection (most commonly in meters).
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")) result = AreaCalc(inputForestMap = yearlyRaster, 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.