# NOT RUN {
# load a spatial polygon object of Navarre
data(ex.navarre)
sres <- 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(sres)
# download the first image in sres
wdir <- file.path(tempdir(),"Path_for_downloading_folder")
print(wdir)
wdir.mod <- file.path(wdir,"Modis","MYD13A2")
wdir.mod.hdf <- file.path(wdir.mod,"hdf")
modDownload(mList[1],
username = "username",
password = "password",
AppRoot = wdir.mod.hdf)
# download all images in mList
modDownload(sres,
username = "username",
password = "password",
AppRoot = wdir.mod.hdf)
# }
Run the code above in your browser using DataLab