Learn R Programming

RGISTools (version 0.9.7)

modDownSearch: Download MODIS images from a search list

Description

modDownSearch downloads the images from a list of uniform resource locator (URL) generated by the modSearch function from NASA<U+2019>s `EartData' plataform. The images are saved as GTiff files in the AppRoot directory.

Usage

modDownSearch(searchres, AppRoot, username = NULL, password = NULL,
  overwrite = FALSE, ...)

Arguments

searchres

the output from the modSearch function.

AppRoot

the directory where the images will be saved.

username

NASA<U+2019>s `EarthData' username.

password

NASA<U+2019>s `EarthData' password.

overwrite

logical argument. If TRUE, overwrites the existing images with the same name.

...

argument for nested functions:

Details

modDownSearch is able to download MODIS Terra and Aqua products. These products are published in the `EarthData' Platform. The platform is supported by the Earth Observing System Data and Information System (EODIS) and managed NASA<U+2019>s Earth Science Data Systems (ESDS). modDownSearch requires credentianls from an `EarthData' account to access the NASA<U+2019>s web data service, which can be obtained here.

Examples

Run this code
# NOT RUN {
# load a spatial polygon object of Navarre
data(ex.navarre)
mList <- modSearch(product = "MYD13A2",
                   startDate = as.Date("01-01-2011", "%d-%m-%Y"),
                   endDate = as.Date("31-12-2013", "%d-%m-%Y"),
                   collection = 6,
                   extent = ex.navarre)
head(mList)
# download the first image in mList
src <- paste0(tempdir(),"/Path_for_downloading_folder")
print(src)
src.mod <- file.path(src,"Modis","MYD13A2")
src.mod.hdf <- file.path(src.mod,"hdf")
modDownSearch(mList[1], 
              username = "user", 
              password = "pass",
              AppRoot = src.mod.hdf)
# download all images in mList
modDownSearch(mList, 
              username = "user", 
              password = "pass",
              AppRoot = src.mod.hdf)
# }

Run the code above in your browser using DataLab