Calculate Global Surface Water (GSW) Seasonality
Source:R/calc_gsw_seasonality.R
gsw_seasonality.Rd
GSW seasonality describes the intra-annual distribution of surface water for
each pixel. The raster files have integer cell values between [0, 12]
,
indicating how many months per year the pixel was classified as water.
Value
A function that returns a tibble with one column months
and one column area
, representing the area covered by each class in
ha.
Details
The pixel values are aggregated using method provided via the
stats
parameter.
The required resources for this indicator are:
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)
mapme_options(
outdir = outdir,
verbose = FALSE
)
aoi <- system.file("extdata", "shell_beach_protected_area_41057_B.gpkg",
package = "mapme.biodiversity"
) %>%
read_sf() %>%
get_resources(get_global_surface_water_seasonality()) %>%
calc_indicators(calc_gsw_seasonality()) %>%
portfolio_long()
aoi
#> Simple feature collection with 13 features and 10 fields
#> Geometry type: POLYGON
#> Dimension: XY
#> Bounding box: xmin: -59.84866 ymin: 8.307999 xmax: -59.71 ymax: 8.364002
#> Geodetic CRS: WGS 84
#> # A tibble: 13 × 11
#> WDPAID NAME DESIG_ENG ISO3 assetid indicator datetime variable unit
#> <dbl> <chr> <chr> <chr> <int> <chr> <date> <chr> <chr>
#> 1 41057 Shell Bea… Managed … GUY 1 gsw_seas… 2021-01-01 gsw_sea… ha
#> 2 41057 Shell Bea… Managed … GUY 1 gsw_seas… 2021-01-01 gsw_sea… ha
#> 3 41057 Shell Bea… Managed … GUY 1 gsw_seas… 2021-01-01 gsw_sea… ha
#> 4 41057 Shell Bea… Managed … GUY 1 gsw_seas… 2021-01-01 gsw_sea… ha
#> 5 41057 Shell Bea… Managed … GUY 1 gsw_seas… 2021-01-01 gsw_sea… ha
#> 6 41057 Shell Bea… Managed … GUY 1 gsw_seas… 2021-01-01 gsw_sea… ha
#> 7 41057 Shell Bea… Managed … GUY 1 gsw_seas… 2021-01-01 gsw_sea… ha
#> 8 41057 Shell Bea… Managed … GUY 1 gsw_seas… 2021-01-01 gsw_sea… ha
#> 9 41057 Shell Bea… Managed … GUY 1 gsw_seas… 2021-01-01 gsw_sea… ha
#> 10 41057 Shell Bea… Managed … GUY 1 gsw_seas… 2021-01-01 gsw_sea… ha
#> 11 41057 Shell Bea… Managed … GUY 1 gsw_seas… 2021-01-01 gsw_sea… ha
#> 12 41057 Shell Bea… Managed … GUY 1 gsw_seas… 2021-01-01 gsw_sea… ha
#> 13 41057 Shell Bea… Managed … GUY 1 gsw_seas… 2021-01-01 gsw_sea… ha
#> # ℹ 2 more variables: value <dbl>, geom <POLYGON [°]>
# }