#' Download data from fisbroker
#' @param zip_link the atom url of the data from fisbroker.
#' @param name name of the folder where the data should be stored. If dolder does not exist the folder will be created
#' @param path path where it has to be stored
#' @return A folder with the data as a geopackage.
#' @export
#' @examples
#' \dontrun{
#' download_fisbroker_atom()
#' }
#### Function
download_fisbroker_atom <- function(zip_link, path ,name){
curl::curl_download(zip_link, destfile = here::here(path ,paste0(name, ".zip")))
utils::unzip(zipfile = here::here(path, paste0(name, ".zip")), exdir = here::here(path, name))
suppressMessages(file.remove(here::here(path, paste0(name, ".zip"))))
curl::curl_download(zip_link, destfile = here::here(path, name, paste0(name, ".tif")))
# you have to set the crs because it is missing sometimes. The default epsg on fisbroker is 25833
ras <- terra::rast(list.files(here::here(path, name),
pattern = ".tif$", full.names = TRUE)[1])
return(ras)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.