getLandsat: Find and download Landsat products

View source: R/getLandsat.R

getLandsatR Documentation

Find and download Landsat products

Description

Find and download Landsat data for a specific product, area, and time period. The function returned is list of filenames that may have been downloaded.

Usage

getLandsat(product="Landsat_8_OLI_TIRS_C1", start_date, end_date, aoi, 
	download=FALSE, path, username, password, version="1", 
	limit=100000, server="AWS", overwrite=FALSE, ...)

Arguments

product

character. Supported products can be found using getProducts, currently limited to Landsat_8_OLI_TIRS_C1

start_date

character. Start date for the data requested formatted yyyy-m-d

end_date

character. end date for the data requested formatted yyyy-m-d

aoi

numeric vector of four elements (minimum longitude, maximum longitude, minimum latitude, maximum latitude) encompassing the area of interest. Or a SpatExtent or Extent object, or any object from which an Extent can be extracted (see examples)

download

logical. If TRUE data will be downloaded unless it is present in the download directory

path

character. Path name indicating where to store the data

username

character. EROS user name (see Details)

password

character. EROS password (see Details)

version

character

limit

integer > 0

server

character. Either AWS (Landsat 8 only) or ERS. See Details

overwrite

logical. If TRUE, existing files are overwritten

...

Additional arguments. These can be product specific. See Details)

Details

The AWS (Amazon Web Services) server provides Landsat 8 data only. It does not require credentials (username and password).

The EROS service from the USGS also provides other Landsat products. To use for downloading data, you need to provide "ERS" credentials. If you do not have these, you can sign up for a free account here: https://ers.cr.usgs.gov/register

If no data is available between start_date and end_date, files for the closest dates are returned.

Value

character vector of file names pointing to the downloaded files (if download=TRUE)

See Also

getProducts, getNASA

Examples

  

product <- "Landsat_8_OLI_TIRS_C1"
sdate <- "2019-05-01" 
edate <- "2019-05-30"
area <- c(33, 34, -5, -4)
dir <- tempdir()
f <- getLandsat(product, start_date=sdate, end_date=edate,
            aoi=area, download=FALSE, path=dir)
            
# An example of ARD Tiles from ERS server
product <- "Landsat4-8_ARD_US_C1"
area <- c(-122.43, -121.50, 38.32, 38.91)
f1 <- getLandsat(product, start_date=sdate, end_date=edate,
            aoi=area, download=FALSE, path=dir, server="EROS")

rspatial/luna documentation built on Dec. 26, 2024, 12:33 a.m.