Skip to contents

Links annual enhanced vegetation index (EVI) based on the location of each s2 cell and dates. For each year, EVI is defined as the mean EVI within buffer meters of the location, extracted from a 250 m annual MODIS Terra/Aqua EVI composite whose pixels are the median of all good or marginal-quality 16-day EVI observations in that year. Buffers that cross MODIS tile boundaries include pixels from all intersecting tiles in one mean. Only completed calendar years are supported. Missing Terra/Aqua acquisitions produce a warning by default; use require_complete = TRUE to reject gaps.

Usage

get_evi_summary(
  x,
  buffer = 400,
  overwrite = FALSE,
  quiet = FALSE,
  require_complete = FALSE
)

Arguments

x

a s2_cell_dates vector (see ?s2cd)

buffer

distance from s2 cell (in meters) to summarize data

overwrite

logical; rebuild existing annual EVI rasters from the current source listing, downloading the source assets again?

quiet

logical; show download progress messages?

require_complete

logical; if TRUE, require every expected acquisition for each tile-year, including when reading offline caches. Defaults to FALSE to summarize available observations with a warning about missing acquisitions.

Value

a list of numeric vectors of annual EVI summaries.

Details

Data are downloaded from the Microsoft Planetary Computer mirror of NASA LP DAAC MOD13Q1/MYD13Q1 Version 6.1 Cloud Optimized GeoTIFFs. See https://planetarycomputer.microsoft.com/dataset/modis-13Q1-061 for collection details. Source 16-day EVI and pixel reliability rasters are staged under the get_evi_summary subdirectory of geomarker's durable managed local copy directory only when an annual composite is missing. If a build fails, complete source downloads are reused on the next attempt and removed after the annual composite is successfully written. EVI source rasters are downloaded by MODIS tile; 14 MODIS tiles intersect the contiguous United States. Planetary Computer assets are accessed with reusable container SAS tokens to reduce signing API calls. Annual composite rasters are retained there as durable managed local copies. Each composite has an adjacent DCF manifest with its exact source items, processing version, missing acquisitions, coverage status, and raster SHA-256. Online use rebuilds incomplete composites when their source inputs change. Offline use warns about cached gaps and cannot check for new source inputs. Composites with complete coverage remain unchanged until overwrite = TRUE, which queries and downloads the latest sources. Older composites without a valid manifest are rebuilt online; offline use produces an explanatory error. The bundled Cincinnati EVI fixture is deterministic synthetic example data. It must not be used for analysis. EVI source raster values are scaled by 0.0001 while creating annual composites. EVI is a greenness index designed to emphasize photosynthetically active vegetation while reducing atmospheric and soil background effects. In this MODIS product, scaled EVI values are expected to range from about -0.2 to 1.0; higher values indicate denser or more vigorous green vegetation, values near 0 indicate little green vegetation, and negative values usually indicate water, snow, cloud, or other non-vegetated surfaces or artifacts.

Examples

local({
  withr::local_envvar(
    R_USER_DATA_DIR = fs::path_package("geomarker", "gmrkr--8841"),
    R_GEOMARKER_NO_DOWNLOAD = "true"
  )
  print(get_evi_summary(s2cd_example_cincy(2L)))
  print(get_evi_summary(s2cd_example_cincy(2L), buffer = 1200, quiet = TRUE))
})
#> $`884193c9eaaaaaab`
#>      2024 
#> 0.4940038 
#> 
#> $`8840fc8940000001`
#>      2024 
#> 0.2301206 
#> 
#> $`88415a16bfffffff`
#>      2024 
#> 0.3043299 
#> 
#> $`88400bf540000001`
#>     2024 
#> 0.270055 
#>