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

'sf' (or 'Spatial*') object defining the area of interest. Can be of any geometry as only the bounding box is used.

satellites

character vector, if specified only the listed satellites will be retrieved, if NULL (default value) the acquisition plans for all possible satellites will be retrieved. For simplicity, the satellites names can be abbreviated to "S-1A", "S-1B", "S-2A", "S-2B", "L-8", "L-9" or "S1A", "S1B", "S2A", "S2B", "L8", "L9". Default: NULL

date_from

date or character convertible to date by as.Date, indicating the earliest image date. Default: NULL

date_to

date or character convertible to date by as.Date, indicating the latest image date. Default: NULL

footprint

logical indicating if the polygons describing the image tiles should be returned. Default: FALSE

api_key

character containing your API key. Default: Sys.getenv("spectator_earth_api_key")

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)
 }

[Package spectator version 0.2.0 Index]