if(interactive()){
library(sf)
my_key <- Sys.getenv("spectator_earth_api_key")
# get the New York City Central Park shape as area of interest
dsn <- system.file("extdata", "centralpark.geojson", package = "spectator")
boundary <- sf::read_sf(dsn, as_tibble = FALSE)
# search for May 2021 Sentinel 2 images
catalog <- SearchImages(aoi = boundary, satellites = "S2",
date_from = "2021-05-01", date_to = "2021-05-30",
footprint = FALSE, api_key = my_key)
}
Run the code above in your browser using DataLab