Skip to contents

Google Earth Engine: get data for years in parallel

Usage

gee_get_data_for_years_parallel(
  years = 2018,
  lakes,
  image_collection = "COPERNICUS/S2_SR_HARMONIZED",
  bands = NULL,
  point_on_surface = FALSE,
  spatial_fun = "mean",
  scale = 10,
  via = "getInfo",
  col_lakename = "SEE_NAME",
  col_lakeid = "SEE_KZ",
  set_lakenames_as_list_indices = TRUE,
  debug = TRUE,
  debug_dir = tempdir(),
  ee_print = FALSE,
  export_rds = TRUE,
  export_dir = tempdir(),
  ncores = parallel::detectCores() - 1,
  n_year_splits = NULL,
  return_list = FALSE
)

Arguments

years

years vector of years for which satellite data should be downloaded

lakes

lakes sf data frame witch shapes of lakes

image_collection

image collection (default: "COPERNICUS/S2_SR_HARMONIZED")

bands

bands (defualt: NULL), for selection provide in the following format: as.list(c("QA60", paste0("B", 1:6)))

point_on_surface

use sf::st_point_on_surface or polygon? (default: FALSE)

spatial_fun

spatial aggregation function (default: "mean")

scale

scale parameter (default: 10), for details, see https://developers.google.com/earth-engine/guides/scale

via

via (default: "getInfo"), other options use google cloud (google drive or google cloud storage)

col_lakename

col_lakename ("GEWNAME", used by Berlin authority for surface water bodies) use "SEE_NAME" for Brandenburg lakes (default: "SEE_NAME")

col_lakeid

("GEWRNEU", used by Berlin authority for surface water bodies) use "SEE_KZ" for Brandenburg lakes (default: "SEE_KZ")

set_lakenames_as_list_indices

should lake names of "col_lakename" be used for naming result list? (default: TRUE)

debug

show debug messages (default: TRUE)

debug_dir

directory where to save (default: tempdir())

ee_print

show debug messages for "ee" (default: FALSE)

export_rds

save sat data into rds object for each lake (default: TRUE)

export_dir

directory where to save data for each lake (default: tempdir())

ncores

number of cores for parallel processinfg (default: parallel::detectCores() - 1)

n_year_splits

number of year splits per request. Required in case request uses too much images > 400-500 per year (default: NULL, determined automatically within function. In case it should be overwritten by the user provide a meaningful integer number)

return_list

should results be provided as R list? (default: FALSE). If FALSE, the rds_path to the exported data is provided in case export_rds is set to TRUE

Value

list with data and metadata, each of them tibbles (if return_list = TRUE), If FALSE, the rds_path to the exported data is provided in case export_rds is set to TRUE. In case an error occurs NULL is returned