Skip to contents

This function allows to efficiently retrieve the name of the ecoregions and compute the corresponding area from Terrestrial Ecoregions of the World (TEOW) - World Wildlife Fund (WWF) for polygons. For each polygon, the name and area of the ecoregions (in hectare) is returned. The required resources for this indicator are:

Usage

calc_ecoregion()

Value

A function that returns an indicator tibble with ecoregion type as variable and corresponding area (in ha) as value.

Examples

# \dontrun{
library(sf)
library(mapme.biodiversity)

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

mapme_options(
  outdir = outdir,
  verbose = FALSE
)

aoi <- system.file("extdata", "sierra_de_neiba_478140_2.gpkg",
  package = "mapme.biodiversity"
) %>%
  read_sf() %>%
  get_resources(get_teow()) %>%
  calc_indicators(calc_ecoregion()) %>%
  portfolio_long()
#> Resource 'teow' is already available.

aoi
#> Simple feature collection with 1 feature and 8 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: 1 × 9
#>   WDPAID ISO3  assetid indicator datetime            variable       unit   value
#>    <dbl> <chr>   <int> <chr>     <dttm>              <chr>          <chr>  <dbl>
#> 1 478140 DOM         1 ecoregion 2001-01-01 00:00:00 hispaniolan_p… ha    18349.
#> # ℹ 1 more variable: geom <POLYGON [°]>
# }