Skip to contents

Computes NDVI from Landsat 9 OLI-2 Collection 2 Level-2 surface reflectance (LANDSAT/LC09/C02/T1_L2) on Google Earth Engine. Cloud, shadow, and snow pixels are masked using the QA_PIXEL band.

Usage

read_landsat(
  date,
  region,
  backend = c("rest", "rgee"),
  cache = TRUE,
  max_tries = 3L,
  initial_delay = 1
)

Arguments

date

Character or Date. Acquisition date in "YYYY-MM-DD" format.

region

An sf::sf, sf::st_sfc(), or terra::ext() object defining the spatial extent. Required.

backend

Character. "rest" (default) or "rgee".

cache

Logical. Use disk cache? Default TRUE.

max_tries

Integer. Retry attempts. Default 3L.

initial_delay

Numeric. Initial retry delay in seconds. Default 1.

Value

A terra::rast() SpatRaster. CRS: EPSG:4326. Values: NDVI (-1 to 1). NA where QA_PIXEL indicates cloud, shadow, or snow.

Data availability

2021-10-31 to present. 16-day revisit. 30 m spatial resolution.

References

U.S. Geological Survey. Landsat 9 Collection 2 Level-2 Science Products. doi:10.5066/P9OGBGM6

Examples

if (FALSE) { # interactive()
ndvi <- read_landsat(date = "2024-06-15",
                     region = terra::ext(138, 140, -36, -34))
}