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,
tile = NULL, outdir = ".", order_lta = TRUE, overwrite = FALSE)

## Arguments

s2_prodlist Named character: list of the products to be downloaded (this must be the output of s2_list function). Alternatively, it can be the path of a JSON file exported by s2_order. Executable to use to download products (default: "builtin"). Alternatives are "builtin" or "aria2" (this requires aria2c to be installed). Path of the "apihub.txt" file containing credentials of SciHub account. If NA (default), the default location inside the package will be used. Deprecated argument (optional) Full name of the existing output directory where the files should be created (default: current directory). 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. Logical value: should existing output archives be overwritten? (default: FALSE)

## Value

NULL (the function is called for its side effects)

## Examples

if (FALSE) {
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)

}