Skip to contents

This function returns map data from DAWA. It is ready to use with {sf} functions. The returned dataframe has date-time columns to inform when the information was last changed. It is returned in Europe/Copenhagen time as that is the local time for the API. You can change that behavior by setting Sys.setenv(TZ = "Your/Timezone").

Usage

get_map_data(type, cache = TRUE, ...)

Arguments

type

Defines the type of map data to request from DAWA. Run available_sections(format = "geojson") to see your options.

cache

Boolean to determine whether or not to cache the api call and the function output. Default is TRUE.

...

<dynamic-dots> input query parameters.

Value

Returns a data.frame object that contains polygons (or points) for the section provided.

Examples

if (FALSE) { # \dontrun{
x <- get_map_data("regioner")
ggplot2::ggplot(x) +
  ggplot2::geom_sf()
} # }