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