Skip to contents

The function returns the proportion of each region's area that is covered by surface water for each year. The values are expressed as a decimal ratio between 0 and 1 (e.g., 0.25 means 25% of the area was covered by water).

[Experimental]

Usage

l4h_water_proportion(
  from,
  to,
  region,
  fun = "mean",
  sf = TRUE,
  quiet = FALSE,
  force = FALSE,
  ...
)

Arguments

from

Integer. Start year (e.g., 1985).

to

Integer. End year (e.g., 2022). Must be equal to or greater than from.

region

A spatial object defining the region of interest. Can be an sf, sfc object, or a SpatVector (from the terra package).

fun

Character. Summary function to apply. Values include "mean", "sum","median" , etc. Default is "mean".

sf

Logical. Return result as an sf object? Default is TRUE.

quiet

Logical. If TRUE, suppress the progress bar (default FALSE). If FALSE, returns the Earth Engine ImageCollection.

force

Logical. If TRUE, skips internal representativity checks on the input geometry. Defaults to FALSE.

...

arguments of ee_extract of rgee packages.

Value

An object containing annual water coverage. Depending on sf, it may be an sf object, a list, or an Earth Engine ImageCollection with yearly layers.

References

Examples

if (FALSE) { # \dontrun{
# Extract water coverage between 2000 and 2020
l4h_water_proportion(from = 2000, to = 2020, region = my_basin)
} # }