modDownload | R Documentation |
modDownload
downloads the images from a list of uniform resource
locators (URLs) generated by the modSearch
function from NASA’s
‘EartData’ plataform. The images are saved as GTiff files in the
AppRoot
directory.
modDownload( searchres, AppRoot, username = NULL, password = NULL, nattempts = 5, verbose = FALSE, extract.tif = FALSE, overwrite = FALSE, raw.rm = FALSE, ... )
searchres |
the output from the |
AppRoot |
the directory where the images will be saved. |
username |
NASA’s ‘EarthData’ username. |
password |
NASA’s ‘EarthData’ password. |
nattempts |
the number of attempts to download an image in case it becomes corrupted. |
verbose |
logical argument. If |
extract.tif |
logical argument. If |
overwrite |
logical argument. If |
raw.rm |
logical argument. If |
... |
argument for nested functions:
|
modDownload
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’s Earth Science Data Systems (ESDS).
modDownload
requires credentianls from an ‘EarthData’ account to
access the NASA’s web data service, which can be obtained
here.
When extract.tif = TRUE
, the function decompresses the imagery. If
only a subset of bands is required, band names can be provided through the
bFilter
argument. The band names are specified by “B” and the two-digit
band number (e.g., “B01”). Image decompression duplicates the information due
to the presence of both, compressed and decompressed images. Set
raw.rm = TRUE
to remove former ones.
this function does not return anything. It saves the imagery as
'hdf’ (and GTiff files) in a folder called 'raw’ ('tif’) in the
AppRoot
directory.
## 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) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.