s2_download | R Documentation |
The function downloads S2 products. Input filenames must be elements obtained with s2_list function (each element must be a URL, and the name the product name).
s2_download(
s2_prodlist = NULL,
downloader = "builtin",
apihub = NA,
service = NA,
tile = NULL,
outdir = ".",
order_lta = TRUE,
abort = TRUE,
overwrite = FALSE
)
s2_prodlist |
Named character: list of the products to be downloaded,
in the format |
downloader |
Executable to use to download products (default: "builtin"). Alternatives are "builtin" or "aria2" (this requires aria2c to be installed). |
apihub |
Path of the |
service |
Character: it can be |
tile |
Deprecated argument |
outdir |
(optional) Full name of the existing output directory where the files should be created (default: current directory). |
order_lta |
Logical: if TRUE (default), products which are not available for direct download are ordered from the Long Term Archive; if FALSE, they are simply skipped. |
abort |
Logical parameter: if TRUE (default), the function aborts in case of errors during downloads; if FALSE, a warning is shown and download of subsequent products continues. |
overwrite |
Logical value: should existing output archives be overwritten? (default: FALSE) |
Vector character with the list ot the output products (being downloaded or already existing).
License: GPL 3.0
Luigi Ranghetti, phD (2020)
Lorenzo Busetto, phD (2019)
L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.cageo.2020.104473")}, URL: https://sen2r.ranghetti.info/.
## Not run:
single_s2 <- paste0("gs://gcp-public-data-sentinel-2/L2/tiles/32/T/NR/",
"S2B_MSIL2A_20200804T101559_N0214_R065_T32TNR_20200804T145113.SAFE/")
names(single_s2) <- "S2B_MSIL2A_20200804T101559_N0214_R065_T32TNR_20200804T145113.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())
file.info(file.path(tempdir(),names(single_s2)))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.