download_archive.Rd
Core function used to downlaod archives
download_archive(
to_do,
extension = c("gz", "zip", "7z"),
name = NULL,
date = NULL,
version = NULL,
verbose = FALSE
)
data.frame. Two columns of character are expected.
character, vector of acceptable types of archive to be downloaded.
character, vector of acceptable names fo archive to be downloaded
character, something like a date that should be used as a filter.
character, something like a version that should be used as a filter.
logical, should the function send somme messages while running.
nothing
This function is used by other more specific functions. It takes as input a to_do data.frame giving correspondance between origin urls to local destinations. It also to select some types of archives to be downloaded. On the good construction of the to_do data.frame depends the success of the downloads!
if (FALSE) {
destination = tempdir()
to_do_cquest = data.frame(
origin = "https://data.cquest.org/registre_parcellaire_graphique/2018",
destination = destination,
short = "rpg_cquest",
stringsAsFactors = FALSE
)
download_archive(to_do_cquest, version = "D976", verbose = TRUE)
to_do_ign = data.frame(
origin = "https://geoservices.ign.fr/rpg",
destination = destination,
short = "rpg_ign",
stringsAsFactors = FALSE
)
download_archive(to_do_ign, version = "D976", date = "2020", verbose = TRUE)
download_archive(to_do_ign, version = "D976", verbose = TRUE)
to_do = rbind(to_do_cquest, to_do_ign)
download_archive(to_do, version = "D976", verbose = TRUE)
}