The land cover data shows us how much of the region is covered by forests, rivers, wetlands, barren land, or urban infrastructure thus allowing the observation of land cover dynamics over a period of time. This function allows to efficiently calculate area of different landcover classes for polygons. For each polygon, the area of the classes in hectare(ha) is returned. The required resources for this indicator are:
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 = 2016:2017,
outdir = file.path(temp_loc, "res"),
tmpdir = tempdir(),
add_resources = FALSE,
verbose = FALSE
) %>%
get_resources("esalandcover") %>%
calc_indicators("landcover") %>%
tidyr::unnest(landcover)))
#> Simple feature collection with 22 features and 17 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: 22 × 18
#> WDPAID NAME DESIG_ENG ISO3 assetid area.40 area.112 area.114 area.115
#> <dbl> <chr> <chr> <chr> <int> <dbl> <dbl> <dbl> <dbl>
#> 1 478140 Sierra de … National… DOM 1 0 0 0 0
#> 2 478140 Sierra de … National… DOM 1 0 0 0 0
#> 3 478140 Sierra de … National… DOM 1 0 0 0 0
#> 4 478140 Sierra de … National… DOM 1 0 0 0 0
#> 5 478140 Sierra de … National… DOM 1 1.15 0 0 0
#> 6 478140 Sierra de … National… DOM 1 1.15 0 0 0
#> 7 478140 Sierra de … National… DOM 1 0 4653. 0 0
#> 8 478140 Sierra de … National… DOM 1 0 4653. 0 0
#> 9 478140 Sierra de … National… DOM 1 0 0 10.3 0
#> 10 478140 Sierra de … National… DOM 1 0 0 10.3 0
#> # ℹ 12 more rows
#> # ℹ 9 more variables: area.116 <dbl>, area.122 <dbl>, area.124 <dbl>,
#> # area.125 <dbl>, area.126 <dbl>, classes <chr>, year <chr>, area <dbl>,
#> # geom <POLYGON [°]>