Skip to contents

Filters OData and STAC rows that intersect with spatial feature y.

Usage

st_intersects.odata_request(x, y, sparse = FALSE, ...)

st_intersects.stac_request(x, y, sparse = FALSE, ...)

Arguments

x

Either an odata_request class object, generated with dse_odata_products_request()/dse_odata_bursts_request(); or a stac_request generated with dse_stac_search_request().

y

A spatial geometry of either class sf (see sf::st_as_sf()) or sfc (see sf::st_as_sfc()). It will always be transformed to WGS 84 projection (EPSG:4326).

sparse

Argument inherited from generic definition. Ignored in this context

...

Ignored

Value

Returns an object of the same class as x, with the geometry filter added to it.

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::collect()

  dse_stac_search_request() |>
    st_intersects(bbox) |>
    dplyr::collect()
}