Learn R Programming

RGISTools (version 1.0.2)

lsEspaUpdateOrders: Updates the status of a request made to ESPA

Description

lsEspaUpdateOrders checks the current status of a request made to EROS Centre Science Processing Architecture (ESPA) to pre-process Landsat level-1 images

Usage

lsEspaUpdateOrders(
  orders,
  username = NULL,
  password = NULL,
  c.handle = NULL,
  verbose = FALSE
)

Arguments

orders

a list of the requested orders as returned by lsEspaGetOrderImages.

username

USGS's `EarthExplorer' username.

password

USGS's `EarthExplorer' password.

c.handle

a curl handler created with the package `curl' to stablish a connection with a preset password and username. This argument is mandatory if username and password are not defined.

verbose

logical argument. If TRUE, the function prints the running steps and warnings.

Value

this function returns a dataframe with the updated order information from ESPA.

Details

This function is part of a group of functions used to pre-process Landsat level 1 images. The pre-processing is carried out by ESPA on demand. lsEspaUpdateOrders uses the ID numbers gathered by lsEspaGetOrderImages regarding previous order requests to check the processing status. The function has to be run repeatedly until the status message states <U+201C>complete<U+201D>. All the status messages and their interpretation can be found in the ESPA's API User Guide.

Examples

Run this code
# NOT RUN {
src <- file.path(tempdir(),"Path_for_downloading_folder")
# search Landsat 7 level-1
search.res <- ls7Search(startDate = as.Date("01-01-2017", "%d-%m-%Y"),
                        endDate = as.Date("15-01-2017", "%d-%m-%Y"),
                        lonlat = c(-1.64323, 42.81687),
                        AppRoot = src)
# request to ESPA the prepocessing of level-1 images to get the surface reflectance
orders <- lsEspaOrderImages(search.res = search.res,
                            username = "username", 
                            password = "password", 
                            product = 'sr',
                            verbose = FALSE)
# get an ID for our request
orders <- lsEspaGetOrderImages(username = "username", 
                               password = "password")
# follow up the status of the request
orders <- lsEspaUpdateOrders(orders = orders,
                             username = "username", 
                             password = "password")
# }

Run the code above in your browser using DataLab