Skip to contents

This function allows to efficiently calculate area of mangrove from Global Mangrove Watch - World Conservation Monitoring Centre (WCMC) for polygons. For each polygon, the area of the mangrove (in hectare) for desired year is returned. The required resources for this indicator are:

Format

A tibble with a column for area of mangrove (in ha) and corresponding year.

Examples

library(sf)
library(mapme.biodiversity)

temp_loc <- file.path(tempdir(), "mapme.biodiversity")
if (!file.exists(temp_loc)) {
  dir.create(temp_loc)
  resource_dir <- system.file("res", package = "mapme.biodiversity")
  file.copy(resource_dir, temp_loc, recursive = TRUE)
}

(try(aoi <- system.file("extdata", "sierra_de_neiba_478140_2.gpkg",
  package = "mapme.biodiversity"
) %>%
  read_sf() %>%
  init_portfolio(
    years = c(1996, 2016),
    outdir = file.path(temp_loc, "res"),
    tmpdir = tempdir(),
    add_resources = FALSE,
    verbose = FALSE
  ) %>%
  get_resources("gmw") %>%
  calc_indicators("mangroves_area") %>%
  tidyr::unnest(mangroves_area)))
#> Skipping existing files in output directory.
#> Translating shapefiles to GeoPackages. This may take a while....
#> 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 mangrove_extent year 
#>    <dbl> <chr>           <chr>         <chr>   <int>           <dbl> <chr>
#> 1 478140 Sierra de Neiba National Park DOM         1               0 1996 
#> 2 478140 Sierra de Neiba National Park DOM         1               0 2016 
#> # ℹ 1 more variable: geom <POLYGON [°]>