getLandsat_preview previews a single Landsat record as image on a map or as RGB plot. The function is useful to apply visual checks to records before downloading them.

getLandsat_preview(record, on_map = TRUE, show_aoi = TRUE,
  verbose = TRUE)



data.frame, single row data.frame collected from the return of getLandsat_query, representing the selected record and all its attributes.


logical, if TRUE, the preview is displaed corner-georeferenced on a map. If FALSE, a simple RGB plot is displayed. Default is TRUE.


logical, if TRUE, the session AOI defined with set_aoi is drawn to the map viewer. Ignored, if on_map = FALSE or if no AOI has been defined with set_aoi. Default is TRUE.


logical, if TRUE, details on the function's progress will be visibile on the console. Default is TRUE.


None. A plot/view display is generated.

See also


## Load packages library(getSpatialData) library(sf) ## set aoi and time range for the query set_aoi(aoi_data[[1]]) time_range <- c("2017-08-01", "2017-08-30") ## Login to USGS ERS
# NOT RUN { login_USGS("username") ## set archive directory set_archive("/path/to/archive/") ## get available products and select one product_names <- getLandsat_names() ## query for records for your AOI, time range and product query <- getLandsat_query(time_range = time_range, name = product_names[7]) ## preview a record getLandsat_preview(query[5,]) #print available levels for a record query[5,]$levels_available ## download record 5 with level "l1" (will direct to AWS automaticaly) files <- getLandsat_data(records = query[5,], level = "l1", source = "auto") ## download record 5 with level "sr" (will be processed on demand by ESPA) files <- getLandsat_data(records = query[5,], level = "sr", source = "auto") # this can take very long, since the function will wait, # until the processing by ESPA is done ## you can abort the function while it is waiting for ESPA and resume later: files <- getLandsat_data(espa_order = "") # the order IDs are displayed and send by mail, use them to resume the task # }