Create a OData Request for a Data Space Ecosystem Product
Source:R/odata_products.R
dse_odata_products_request.RdOData is an application programming interface (API) used to disseminate Copernicus
Data Space Ecosystem products. This function creates a request for this service,
which can be used to obtain a data.frame with product information. This request
supports several tidyverse methods for filtering and arranging the data.
Arguments
- ...
Ignored in case of
dse_odata_products_request(). Dots are passed to embeddeddplyr::filter()in case ofdse_odata_products()- expand
Additional information to be appended to the result. Should be any of
"Attributes","Assets", or"Locations". Note that, these columns are not affected bydplyr::select()calls (before callingdplyr::collect()).
Value
Returns an odata_request class object in case of
dse_odata_products_request(), which is an extension of httr2::request().
In case of dse_odata_products() a data.frame listing requested products is
returned.
Details
You can apply some tidyverse functions (see tidy_verbs) to odata_request
object returned by dse_odata_products_request(). These apply lazy evaluation.
Meaning that they are just added to the object and are only evaluated after
calling either dplyr::compute() or dplyr::collect() (see examples).
Examples
if (interactive()) {
bbox <-
sf::st_bbox(
c(xmin = 5.261, ymin = 52.680, xmax = 5.319, ymax = 52.715),
crs = 4326) |>
sf::st_as_sfc()
dse_odata_products_request() |>
dplyr::filter(
`ContentDate/Start` > "2025-01-01") |>
sf::st_intersects(bbox) |>
dplyr::arrange(dplyr::desc(Id)) |>
dplyr::slice_head(n = 100) |>
dplyr::collect()
}