pa_get_vi_stats: Request vegetation index statistics from the Data Space...

View source: R/statistics_api.R

pa_get_vi_statsR Documentation

Request vegetation index statistics from the Data Space Statistics API

Description

Request vegetation index statistics from the Data Space Statistics API

Usage

pa_get_vi_stats(
  aoi,
  start.date,
  end.date,
  collection = c("sentinel-2-l2a"),
  vegetation.index = c("bsi", "evi", "gcvi", "ndre", "ndvi", "reci"),
  agg.time = c("P1D", "P5D", "P10D"),
  by.feature = FALSE
)

Arguments

aoi

sf object used to filter satellite products

start.date

beginning of the time window to filter satellite products. Date format should be '%Y-%m-%d'.

end.date

end of the time window to filter satellite products. Date format should be '%Y-%m-%d'.

collection

for now, it only supports 'sentinel2'.

vegetation.index

vegetation index to be requested from the Data Space

agg.time

aggregation time of the satellite products

by.feature

logical, indicating whether the statistics should be retrieved by each polygon when multiple polygons are supplied in ‘aoi’

Details

'pa_get_vi_sentinel2()' will use HTTP requests to communicate with the Data Space Statistics API and request areal statistics for the specified vegetation index

Value

returns an object of class veg.index and stars

Author(s)

Caio dos Santos and Fernando Miguez

Examples

## Not run: 
extd.dir <- system.file("extdata", package = "pacu")
area.of.interest <- sf::st_read(file.path(extd.dir, 'cobs_a_aoi.shp'), quiet = TRUE)
ndvi <- pa_get_vi_stats(aoi = area.of.interest,
                        start.date = '2021-01-01',
                        end.date = '2021-12-31',
                        vegetation.index = 'ndvi')

## End(Not run)


pacu documentation built on June 8, 2025, 10:44 a.m.