getNASA | R Documentation |
Find and download NASA data for a specific product, area, and time period. The function returned is list of filenames that may have been downloaded.
It is important to fist consult getProducts
to discover what products and version numbers are available, and which server to use.
getNASA(product, start_date, end_date, aoi, version="006", download=FALSE, path,
username, password, server="LPDAAC_ECS", limit=100000, overwrite=FALSE, ...)
product |
character. Supported products can be found using |
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. It can also be a SpatExtent, or any object from which an extent can be extracted |
version |
character. product version |
download |
logical. If |
path |
character. Path name indicating where to store the data |
username |
character. EOSDIS user name (see Details) |
password |
character. EOSDIS password (see Details) |
server |
character. The server to download the data from |
limit |
positive integer |
overwrite |
logical. If |
... |
Additional arguments. These can be product specific. See Details) |
This function is an R interface to the EOSDIS system. Access is free, but it requires a "Earthdata" account. If you do not have an account, you can sign up here: https://urs.earthdata.nasa.gov/users/new
If no data is available between start_date
and end_date
, files for the closest dates are returned.
Character vector of file names pointing to the downloaded files (if download=TRUE
)
getProducts
, getLandsat
product <- "MOD09A1"
# information about the product
getProducts(product)
sdate <- "2019-05-17"
edate <- "2019-05-23"
area <- c(33, 34, -5, -4)
path <- tempdir()
# list available tiles
f <- getNASA(product = product,
start_date = sdate, end_date = edate,
aoi = area, download = FALSE, path=path)
f
# get the date from the filenames
modisDate(f)
# to download the tiles, set download = TRUE
# and provide your credentials
usr <- "your user name"
pwd <- "your password"
#f <- getNASA(product = product, username=urs, password=pwd,
# start_date = sdate, end_date = edate,
# aoi = area, download = TRUE, path=path)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.