Passer au contenu

Downloads ESA WorldCover 10m land cover data from Google Earth Engine. WorldCover v200 is a static 2021 baseline product without annual updates.

Utilisation

download_esa_worldcover_data(
  boundary_layer,
  iso3,
  gee_project,
  output_dir = here::here(),
  pus = NULL,
  aggregate_to_pus = FALSE,
  wait_time = 5,
  ...
)

Arguments

boundary_layer

An sf object defining the spatial boundary of interest.

iso3

Character. Three-letter ISO country code for filename generation.

gee_project

Character. Google Earth Engine cloud project ID. This is required and must be a valid GEE project you have access to. Find your project ID in the GEE Code Editor.

output_dir

Character. Local output directory. Defaults to project root via here::here().

pus

SpatRaster or NULL. Planning units raster for GEE-side aggregation. When provided with aggregate_to_pus = TRUE, the export will be resampled to match the PU resolution and projection in GEE before download.

aggregate_to_pus

Logical. If TRUE and pus is provided, aggregate the data to planning unit resolution in GEE before export. This significantly speeds up processing by eliminating local resampling. Default is FALSE.

wait_time

Numeric. Maximum time in minutes to wait for the GEE export to appear in Google Drive. Default is 5. Increase for large exports.

...

Additional arguments passed to download_gee_layer().

Valeur de retour

A SpatRaster object of the downloaded ESA WorldCover data, or NULL if download failed.

Détails

ESA WorldCover class values:

  • 10: Tree cover

  • 20: Shrubland

  • 30: Grassland

  • 40: Cropland

  • 50: Built-up

  • 60: Bare / sparse vegetation

  • 70: Snow and ice

  • 80: Permanent water bodies

  • 90: Herbaceous wetland

  • 95: Mangroves

  • 100: Moss and lichen

Use get_lulc_classes("esa_worldcover") to retrieve these mappings programmatically.

Note

ESA WorldCover v200 is a static 2021 baseline product. Unlike ESRI LULC or Dynamic World, it does not have annual updates.

Exemples

if (FALSE) { # \dontrun{
# Download ESA WorldCover for Ghana
esa_lulc <- download_esa_worldcover_data(
  boundary_layer = ghana_boundary,
  iso3 = "GHA",
  gee_project = "my-gee-project"
)

# Download with GEE-side aggregation to planning units
esa_lulc_agg <- download_esa_worldcover_data(
  boundary_layer = ghana_boundary,
  iso3 = "GHA",
  gee_project = "my-gee-project",
  pus = planning_units,
  aggregate_to_pus = TRUE
)
} # }