Title: | Access Danish Geospatial Data |
---|---|
Description: | This package provides access to all geospatial data provided by the danish agency called Klimadatastyrelsen. Under the hood it wraps the `{dawaR}` and `{dkdata}` packages which provide access to the agency APIs. |
Authors: | Aleksander Bang-Larsen [aut, cre, cph]
|
Maintainer: | Aleksander Bang-Larsen <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.0.0.9001 |
Built: | 2025-03-11 15:26:29 UTC |
Source: | https://github.com/rOpenGov/geodk |
Get constituencies
constituencies()
constituencies()
Returns a {sf}
object for the danish constituencies
Other data retrieval:
get_geo()
,
municipalities()
,
parishes()
,
regions()
This function makes it easy for you to enrich your dataframe with appropriate geographical information. The main usage, right now at least, is to enrich statistical data from {geodk}
with geometries for the appropriate levels.
geodk_enrich(x)
geodk_enrich(x)
x |
Dataframe. Preferably from |
Returns a dataframe of the dimensions cols +1 by rows
.
Get geogrpahies
get_geo(section = "postnumre")
get_geo(section = "postnumre")
section |
The geographic level wanted. |
Returns a {sf}
object for the specified geography
Other data retrieval:
constituencies()
,
municipalities()
,
parishes()
,
regions()
Get all available levels
get_levels()
get_levels()
This funciton returns all available levels for the plot_*
functions.
get_levels()
get_levels()
Get municipalities
municipalities()
municipalities()
Returns a {sf}
object for the danish municipalities
Other data retrieval:
constituencies()
,
get_geo()
,
parishes()
,
regions()
Get parishes
parishes()
parishes()
Returns a {sf}
object for the danish parishes
Other data retrieval:
constituencies()
,
get_geo()
,
municipalities()
,
regions()
Plot a nice map of Denmark with borders at a given level. Options to fill based on area names or color borders are included. A legend guide is shown if less than 15 areas are plotted.
plot_denmark(level = "regions", fill = NULL, color = NULL)
plot_denmark(level = "regions", fill = NULL, color = NULL)
level |
The desired administrative geographic level for the map. Should
be one of |
fill |
The desired color for the areas to be filled with. Could be
either a R-friendly color (name or hex code) or |
color |
The desired color for the area borders to be colored with. Could
be either a R-friendly color (name or hex code) or |
Returns a ggplot object that can be manipulated as any other. The object is automatically printed.
plot_denmark() plot_denmark(fill = "names")
plot_denmark() plot_denmark(fill = "names")
Plot a vector of municipalities in Denmark. Just provide the name.
plot_municipalities( municipality = c("København", "Frederiksberg", "Ballerup", "Brøndby", "Dragør", "Gentofte", "Gladsaxe", "Glostrup", "Herlev", "Albertslund", "Hvidovre", "Høje-Taastrup", "Lyngby-Taarbæk", "Rødovre", "Ishøj", "Tårnby", "Vallensbæk", "Furesø", "Allerød", "Fredensborg", "Helsingør", "Hillerød", "Hørsholm", "Rudersdal", "Egedal", "Frederikssund", "Greve", "Køge", "Halsnæs", "Roskilde", "Solrød", "Gribskov", "Odsherred", "Holbæk", "Faxe", "Kalundborg", "Ringsted", "Slagelse", "Stevns", "Sorø", "Lejre", "Lolland", "Næstved", "Guldborgsund", "Vordingborg", "Bornholm", "Middelfart", "Christiansø", "Assens", "Faaborg-Midtfyn", "Kerteminde", "Nyborg", "Odense", "Svendborg", "Nordfyns", "Langeland", "ærø", "Haderslev", "Billund", "Sønderborg", "Tønder", "Esbjerg", "Fanø", "Varde", "Vejen", "Aabenraa", "Fredericia", "Horsens", "Kolding", "Vejle", "Herning", "Holstebro", "Lemvig", "Struer", "Syddjurs", "Norddjurs", "Favrskov", "Odder", "Randers", "Silkeborg", "Samsø", "Skanderborg", "Aarhus", "Ikast-Brande", "Ringkøbing-Skjern", "Hedensted", "Morsø", "Skive", "Thisted", "Viborg", "Brønderslev", "Frederikshavn", "Vesthimmerlands", "Læsø", "Rebild", "Mariagerfjord", "Jammerbugt", "Aalborg", "Hjørring") )
plot_municipalities( municipality = c("København", "Frederiksberg", "Ballerup", "Brøndby", "Dragør", "Gentofte", "Gladsaxe", "Glostrup", "Herlev", "Albertslund", "Hvidovre", "Høje-Taastrup", "Lyngby-Taarbæk", "Rødovre", "Ishøj", "Tårnby", "Vallensbæk", "Furesø", "Allerød", "Fredensborg", "Helsingør", "Hillerød", "Hørsholm", "Rudersdal", "Egedal", "Frederikssund", "Greve", "Køge", "Halsnæs", "Roskilde", "Solrød", "Gribskov", "Odsherred", "Holbæk", "Faxe", "Kalundborg", "Ringsted", "Slagelse", "Stevns", "Sorø", "Lejre", "Lolland", "Næstved", "Guldborgsund", "Vordingborg", "Bornholm", "Middelfart", "Christiansø", "Assens", "Faaborg-Midtfyn", "Kerteminde", "Nyborg", "Odense", "Svendborg", "Nordfyns", "Langeland", "ærø", "Haderslev", "Billund", "Sønderborg", "Tønder", "Esbjerg", "Fanø", "Varde", "Vejen", "Aabenraa", "Fredericia", "Horsens", "Kolding", "Vejle", "Herning", "Holstebro", "Lemvig", "Struer", "Syddjurs", "Norddjurs", "Favrskov", "Odder", "Randers", "Silkeborg", "Samsø", "Skanderborg", "Aarhus", "Ikast-Brande", "Ringkøbing-Skjern", "Hedensted", "Morsø", "Skive", "Thisted", "Viborg", "Brønderslev", "Frederikshavn", "Vesthimmerlands", "Læsø", "Rebild", "Mariagerfjord", "Jammerbugt", "Aalborg", "Hjørring") )
municipality |
Municipality to plot. Mutiple is supported. |
Returns a {ggplot2}
object and prints the plot as well.
plot_municipalities(municipality = c("Aarhus", "Favrskov"))
plot_municipalities(municipality = c("Aarhus", "Favrskov"))
Plot a vector of regions in Denmark. Just provide the name.
plot_regions( region = c("Region Nordjylland", "Region Midtjylland", "Region Syddanmark", "Region Hovedstaden", "Region Sjælland") )
plot_regions( region = c("Region Nordjylland", "Region Midtjylland", "Region Syddanmark", "Region Hovedstaden", "Region Sjælland") )
region |
Region(s) to plot |
Returns a {ggplot2}
object and prints the plot as well.
plot_regions(region = c("Region Nordjylland", "Region Midtjylland"))
plot_regions(region = c("Region Nordjylland", "Region Midtjylland"))
This function prefills the cache of the underlying API-function.
By default the sections shown in the example below is prefilled. This is
meant to replace the cached dataset that once was in the package. It may be
useful to prefill the cache before using geodk_enrich
.
prefill_cache(specific_section = NULL)
prefill_cache(specific_section = NULL)
specific_section |
Enter a seciton name (or vector of section names) you
would like to have pre-filled. Options can be found in
|
Returns nothing. Is called for the side effect of prefilling the cache.
sections <- c( "regioner", "kommuner", "postnumre", "sogne", "regioner", "opstillingskredse", "afstemningsomraader" )
sections <- c( "regioner", "kommuner", "postnumre", "sogne", "regioner", "opstillingskredse", "afstemningsomraader" )
Get regions
regions()
regions()
Returns a {sf}
object for the danish regions
Other data retrieval:
constituencies()
,
get_geo()
,
municipalities()
,
parishes()