# NOT RUN {
# load a spatial polygon object of Navarre
data(ex.navarre)
# main output directory
wdir <- file.path(tempdir(),"Path_for_downloading_folder")
print(wdir)
# download Landsat-8 images
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,
untar = TRUE,
AppRoot = wdir)
# folder with the Landsat-8 untared images
wdir.ls8 <- file.path(wdir, "Landsat8")
tif.src <- file.path(wdir.ls8,"untar")
# mosaic the Landsat-8 images
lsMosaic(src = tif.src,
AppRoot = wdir.ls8,
out.name = "Navarre",
extent = ex.navarre,
gutils = TRUE, # using gdalUtils
overwrite = TRUE) # overwrite
# }
Run the code above in your browser using DataLab