Skip to contents

In order to perform a search using the STAC API, you first need to create a request using dse_stac_search_request(). This creates a httr2::request() to which tidy verbs ?tidy_verbs can be applied (e.g., dplyr::select(), dplyr::filter() and dplyr::arrange(). Results are retrieved by calling dplyr::collect() on the request.

Usage

dse_stac_search_request(collections, ids, ...)

Arguments

collections

Restrict the search to the collections listed here.

ids

Restrict the search to ids listed here.

...

Arguments appended to search filter request body.

Value

Returns a data.frame with search results.

Details

If you prefer a graphical user interface, you can alternatively use the STAC web browser.

Examples

if (interactive()) {
  library(dplyr)
  library(sf)
  
  bbox <-
    sf::st_bbox(
      c(xmin = 5.261, ymin = 52.680, xmax = 5.319, ymax = 52.715),
      crs = 4326)

  dse_stac_search_request("sentinel-2-l1c") |>
    filter(`eo:cloud_cover` < 10) |>
    collect()

  dse_stac_search_request("sentinel-1-grd") |>
    filter(`sat:orbit_state` == "ascending") |>
    arrange("id") |>
    st_intersects(bbox) |>
    collect()
}