# NOT RUN {
single_s2 <- paste0("https://scihub.copernicus.eu/apihub/odata/v1/",
"Products(\'c7142722-42bf-4f93-b8c5-59fd1792c430\')/$value")
names(single_s2) <- "S2A_MSIL1C_20170613T101031_N0205_R022_T32TQQ_20170613T101608.SAFE"
# (this is equivalent to:
# single_s2 <- example_s2_list[1]
# where example_s2_list is the output of the example of the
# s2_list() function)
# Download the whole product
s2_download(single_s2, outdir=tempdir())
#' # Download the whole product - using aria2
s2_download(single_s2, outdir=tempdir(), downloader = "aria2")
# Download more products, ordering the ones stored in the Long Term Archive
pos <- sf::st_sfc(sf::st_point(c(-57.8815,-51.6954)), crs = 4326)
time_window <- as.Date(c("2018-02-21", "2018-03-20"))
list_safe <- s2_list(spatial_extent = pos, time_interval = time_window)
s2_download(list_safe, outdir=tempdir())
# }
Run the code above in your browser using DataCamp Workspace