knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-" )
Package to access to the Map Supply Download via the kortforsyningen FTP. You would need to create an account on kortforsyningen.
if (!require("remotes")) install.packages("remotes") remotes::install_github("javiereliomedina/dangeo")
library(dangeo)
First we would need to define the username and the password for kortforsyningen, and the local directory where the files will be downloaded (i.e. dangeo_set_param()). By default dangeo looks for credentials on .Renviron (kortforsyningen_id = "username" and kortforsyningen_pwd = "password"), and the local directory is defined as dangeo_set_param(loc_dir = rappdirs::user_cache_dir()), although it can be changed (dangeo_set_param(loc_dir = "./local/path")).
# usethis::edit_r_environ() # Open .Renviron file, and save the username (kortforsyningen_id = "username") and password (kortforsyningen_pwd = "password") dangeo_set_param()
Then we can download a ".zip" file (e.g. DK_CORINE_SHP_UTM32-WGS84.zip) in our local directory by calling the function dangeo_get_data(). The file will not be downloaded if it is already in the local directory, but we can overwrite it by setting overwrite = TRUE.
dangeo_get_data(ftp_folder = "CORINE", zip_name = "DK_CORINE_SHP_UTM32-WGS84.zip")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.