Skip to contents

Obtain image stacks from a Google Earth Engine catalog collection for processing. Full support for Sentinel-2, Sentinel-3, Landsat 5-9 and most MODIS satellites. Preprocessing performs server-side filtering, cloud masking, scaling and offsetting, calculation of spectral indices and compositing into a single image representing, for example, the median, min, max, mean, quantile or standard deviation of the images. For unsupported collections, certain functions like scaling, offsetting, spectral indices and cloud/shadow masking may not be available. Must be used on an object created by the function, collect_ee()

Usage

preprocess_ee(
  object,
  mask_clouds = TRUE,
  reduce = "median",
  spectral = NULL,
  clip = TRUE
)

Arguments

object

object: a data object produced by collect_ee()

mask_clouds

logical, optional: perform cloud and shadow masking on image(s). Defaults to TRUE

reduce

string, optional: summary technique used to reduce an image collection to a single composite. Defaults to "median"

spectral

logical, optional: automatically calculate spectral index based on Awesome Spectral Indices. If required bands are not available, the calculation will be skipped. Defaults to NULL

clip

logical, optional: clip the image (removing surrounding data). This mostly affects visualisation - the final download will always respect the bounding box set by coords, regardless of this value. Defaults to TRUE

Value

an updated collect_ee() object that can be passed on to map_ee(), aggregate_ee() or download_ee()

Examples

if (FALSE) {
img <- collect_ee(
  collection = "LANDSAT/LC09/C02/T1_L2",
  coords = c(149.769345, -30.335861, 149.949173, -30.206271),
  date = "2021-06-01",
  end_date = "2022-06-01"
)

preprocess_ee(img, spectral = "NDVI")
}