Skip to contents

This functions allows to efficiently calculate treecover statistics for polygons. For each year in the analysis timeframe, the forest losses in preceding and the current years are subtracted from the treecover in the year 2000 and actual treecover figures within the polygon are returned. The required resources for this indicator are:

Format

A tibble with a column for years and treecover (in ha)

Details

The following arguments can be set:

min_size

The minimum size of a forest patch to be considered as forest in ha.

min_cover

The minimum cover percentage per pixel to be considered as forest.

Examples

# \dontshow{
mapme.biodiversity:::.copy_resource_dir(file.path(tempdir(), "mapme-data"))
# }
# \dontrun{
library(sf)
library(mapme.biodiversity)

outdir <- file.path(tempdir(), "mapme-data")
dir.create(outdir, showWarnings = FALSE)

aoi <- system.file("extdata", "sierra_de_neiba_478140_2.gpkg",
  package = "mapme.biodiversity"
) %>%
  read_sf() %>%
  init_portfolio(
    years = 2016:2017,
    outdir = outdir,
    tmpdir = tempdir(),
    verbose = FALSE
  ) %>%
  get_resources(
    resources = c("gfw_treecover", "gfw_lossyear"),
    vers_treecover = "GFC-2022-v1.10", vers_lossyear = "GFC-2022-v1.10"
  ) %>%
  calc_indicators("treecover_area", min_size = 1, min_cover = 30) %>%
  tidyr::unnest(treecover_area)

aoi
#> Simple feature collection with 2 features and 7 fields
#> Geometry type: POLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -71.80933 ymin: 18.57668 xmax: -71.33201 ymax: 18.69931
#> Geodetic CRS:  WGS 84
#> # A tibble: 2 × 8
#>   WDPAID NAME  DESIG_ENG ISO3  assetid years treecover                      geom
#>    <dbl> <chr> <chr>     <chr>   <int> <int>     <dbl>             <POLYGON [°]>
#> 1 478140 Sier… National… DOM         1  2016    11942. ((-71.76134 18.66333, -7…
#> 2 478140 Sier… National… DOM         1  2017    11871. ((-71.76134 18.66333, -7…
# }