SearchImages {spectator} | R Documentation |
Search Spectator database for available images
Description
Returns the list of available images for an area of interest, specified time interval and selected satellites.
Usage
SearchImages(
aoi,
satellites = NULL,
date_from = NULL,
date_to = NULL,
footprint = FALSE,
api_key = Sys.getenv("spectator_earth_api_key")
)
Arguments
aoi |
' |
satellites |
character vector, if specified only the listed satellites will be retrieved,
if |
date_from |
date or character convertible to date by |
date_to |
date or character convertible to date by |
footprint |
logical indicating if the polygons describing the image tiles should be returned. Default: FALSE |
api_key |
character containing your API key. Default: |
Details
The data frame contains some useful attributes: id
which enables to download images
using the functions GetImageryFilesList
or
GetHighResolutionImage
,
cloud_cover_percentage
(for the whole image tile), satellite
(name),
begin_position_date
and end_position_date
indicating when the image was taken.
Value
Either a data frame (if 'footprint
' is 'FALSE
') or
an object of class 'sf
' with 'POLYGON
' geometry type (if 'footprint
' is 'TRUE
').
Source
https://api.spectator.earth/#searching-for-images
Examples
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)
}