
Maps of Norwegian municipalities in data.table format
Source:R/data_norway_municip.R
nor_municip_map_bxxxx_default_dt.RdWe package the map datasets for Norwegian municipalities, taken from Geonorge, so that you can draw them in ggplot2 with no geolibrary. This data is licensed under Creative Commons BY 4.0 (CC BY 4.0).
Usage
nor_municip_map_b2024_default_dt
nor_municip_map_b2020_default_dt
nor_municip_map_b2019_default_dt
nor_municip_position_geolabels_b2024_default_dt
nor_municip_position_geolabels_b2020_default_dt
nor_municip_position_geolabels_b2019_default_dtFormat
The three nor_municip_map_*_default_dt datasets are data.tables
with one row per polygon vertex:
- long
Longitude in decimal degrees (WGS84).
- lat
Latitude in decimal degrees (WGS84).
- order
Integer draw order carried over from the source polygon conversion.
ggplot2::geom_polygon()follows row order, so you rarely need this column, and its values are not contiguous in every dataset.- group
Factor, one level per closed polygon ring; use as the
groupaesthetic in ggplot2. Several rings can share onelocation_code.- location_code
Municipality code (e.g.
"municip_nor0301").
The three nor_municip_position_geolabels_*_default_dt datasets are
data.tables with one row per municipality. They carry no repel
column, unlike the county label datasets:
- location_code
Municipality code (e.g.
"municip_nor0301").- long
Longitude in decimal degrees (WGS84) of the label anchor.
- lat
Latitude in decimal degrees (WGS84) of the label anchor.
An object of class data.table (inherits from data.frame) with 30601 rows and 5 columns.
An object of class data.table (inherits from data.frame) with 31705 rows and 5 columns.
An object of class data.table (inherits from data.frame) with 356 rows and 3 columns.
An object of class data.table (inherits from data.frame) with 356 rows and 3 columns.
An object of class data.table (inherits from data.frame) with 422 rows and 3 columns.
Source
Kartverket / Geonorge https://www.geonorge.no/. License: CC BY 4.0.
Details
Borders for 2024, 2020, and 2019 are provided, holding 356, 356 and 422 municipalities respectively.
The 2024 datasets are one municipality short of the official 2024 set of 357.
Haram (municip_nor1580) separated from municip_nor1508 on
1 January 2024. It has no polygon here. The municip_nor1508
coordinates are unchanged from municip_nor1507 in the 2020 datasets,
so the Haram area is still inside municip_nor1508.
Each border year has a polygon table (nor_municip_map_*) and a label
table (nor_municip_position_geolabels_*). The two hold the same set of
location_code values, but different columns.
See also
vignette("csmaps", package = "csmaps") draws
nor_municip_map_b2024_default_dt. No vignette uses the 2020 or 2019
datasets, or any label dataset on this page.
Other municipality maps:
nor_municip_map_bxxxx_default_sf,
nor_municip_map_bxxxx_insert_oslo_dt,
nor_municip_map_bxxxx_split_dt
Examples
# 2024 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + geom_polygon(
data = csmaps::nor_municip_map_b2024_default_dt,
mapping = aes(group = group),
color = "black",
fill = "white",
linewidth = 0.2
)
q <- q + theme_void()
q <- q + coord_quickmap()
q
# 2020 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + geom_polygon(
data = csmaps::nor_municip_map_b2020_default_dt,
mapping = aes(group = group),
color = "black",
fill = "white",
linewidth = 0.2
)
q <- q + theme_void()
q <- q + coord_quickmap()
q
# 2019 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + geom_polygon(
data = csmaps::nor_municip_map_b2019_default_dt,
mapping = aes(group = group),
color = "black",
fill = "white",
linewidth = 0.2
)
q <- q + theme_void()
q <- q + coord_quickmap()
q