lsDownSearch | R Documentation |
lsDownSearch
searches and downloads Landsat-7 or Landsat-8 images
concerning a particular location and time interval from the
‘EarthExplorer’ repository.
Images are saved as GTiff files in the AppRoot
directory.
lsDownSearch( satellite, username, password, AppRoot, lvl = 1, product = c("sr", "source_metadata"), verbose = FALSE, untar = TRUE, raw.rm = FALSE, ... )
satellite |
string containing the type of satellite
( |
username |
USGS’s ‘EarthExplorer’ username. |
password |
USGS’s ‘EarthExplorer’ password. |
AppRoot |
the download directory. |
lvl |
a number specifying the processing level. Default value, 1. |
product |
a |
verbose |
logical argument. If |
untar |
logical argument. If |
raw.rm |
logical argument. If |
... |
argumetns for nested functions:
|
lsDownSearch
is a wrapper function of ls7Search
,
ls8Search
, and lsDownload
to search and
download images in a single step. The function requires USGS's ‘EarthExplorer’
credentials, which can be obtained
here.
The files from ‘EarthExplorer’ are compressed as ‘tar.gz’. lsDownSearch
decompresses the images and obtains the corresponding GTiffs. The GTiffs are
saved in the AppRoot
directory. To change this option, provide
AppRoot = “full path”
. When untar=TRUE
, the function untars
the imagery in this location. Image decompression duplicates the information
due to the presence of both, compressed and decompressed images. Set
raw.rm = TRUE
to remove the former ones.
this function does not return anything. It saves the imagery as
'tar.gz’ (and GTiff files) in a folder called 'raw’ ('untar’) in the
AppRoot
directory.
## Not run: # load a spatial polygon object of Navarre data(ex.navarre) wdir <- file.path(tempdir(),"Path_for_downloading_folder") print(wdir) # search and download the images from Landsat-8 between # 01-01-2018 and 20-01-2018 for the region of Navarre lsDownSearch(satellite = "ls8", username = "username", password = "password", startDate = as.Date("01-01-2018", "%d-%m-%Y"), endDate = as.Date("20-01-2018", "%d-%m-%Y"), extent = ex.navarre, AppRoot = wdir) # remove metadata to free memory space lsRemoveMetadata() ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.