Learn R Programming

getSpatialData (version 0.0.4)

getMODIS_names: Get MODIS product names from USGS Earth Explorer

Description

getMODIS_names obtains names of available MODIS products from USGS Earth Explorer. They can optionally be used with the getMODIS_query function for querying a specific MODIS product instead of all.

Usage

getMODIS_names(username = NULL, password = NULL)

Arguments

username

character, a valid user name to the USGS EROS Registration System (ERS). If NULL (default), the session-wide login credentials are used (see login_USGS for details on registration).

password

character, the password to the specified user account. If NULL (default) and no seesion-wide password is defined, it is asked interactively ((see login_USGS for details on registration).

Value

A character vector

See Also

getMODIS_query

Examples

Run this code
# NOT RUN {
## 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 <- getMODIS_names()
product <- grep("MOD13Q1", product_names, value = T)

## query for records for your AOI, time range and product
query <- getMODIS_query(time_range = time_range, name = product)

## preview a record
getMODIS_preview(query[1,])

## download records 1 and 2
files <- getMODIS_data(query[1:2,])
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab