# NOT RUN {
# load a spatial polygon object of Navarre
data(ex.navarre)
# Download S2MSI1C products sensed by Sentinel-2
# between the julian dates 210 and 218, 2018
src <- paste0(tempdir(),"/Path_for_downloading_folder")
print(src)
senDownload(startDate = as.Date("2018210", "%Y%j"),
endDate = as.Date("2018218", "%Y%j"),
platform = "Sentinel-2",
extent = ex.navarre,
product = "S2MSI1C",
pathrow = c("R094"),
username = "username",
password = "password",
AppRoot = src)
src.sen <- file.path(src, "Sentinel-2")
src.sen.unzip <- file.path(src.sen, "unzip")
files <- list.files(src.unzip,
pattern = "\\TCI.jp2$",
full.names = TRUE,
recursive = TRUE)
rgb <- stack(files[1])
plotRGB(rgb)
# }
Run the code above in your browser using DataLab