Learn R Programming

pacu (version 0.1.74)

pa_get_vi_stats: 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
)

Value

returns an object of class veg.index and stars

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’

Author

Caio dos Santos and Fernando Miguez

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

Examples

Run this code
if (FALSE) {
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')
}

Run the code above in your browser using DataLab