extract_drive_stats: Extract Large-Scale Statistics in Drive Mode with Fewer Tasks

View source: R/run_geelite.R

extract_drive_statsR Documentation

Extract Large-Scale Statistics in Drive Mode with Fewer Tasks

Description

Batches multiple geometry chunks into fewer ee_table_to_drive tasks, reducing overhead and leveraging Google Earth Engine's parallel processing.

Usage

extract_drive_stats(
  sf_chunks,
  imgs,
  band,
  stat,
  stat_fun,
  scale,
  folder = ".geelite_tmp_drive",
  user = NULL,
  pb,
  pb_step
)

Arguments

sf_chunks

[mandatory] (list) A list of sf data frames representing geometry chunks.

imgs

[mandatory] (ee$ImageCollection) The Earth Engine image collection to extract statistics from.

band

[mandatory] (character) The band name (e.g., "NDVI").

stat

[mandatory] (character) The statistical function to apply (e.g., "mean").

stat_fun

[mandatory] (ee$Reducer) The Earth Engine reducer function.

scale

[mandatory] (numeric) The spatial resolution in meters for reduceRegions.

folder

[optional] (character) Name of the Google Drive folder where exports will be stored. Defaults to ".geelite_tmp_drive".

user

[optional] (character) GEE user profile name, if applicable.

pb

[mandatory] (Progress bar object) A progress bar instance from progress::progress_bar or similar package. Used to track task progress.

pb_step

[mandatory] (numeric) The step size for updating the progress bar.

Value

(data.frame) A merged data frame containing extracted statistics from all Drive exports.


geeLite documentation built on Aug. 9, 2025, 1:08 a.m.