Skip to contents

We package the map datasets for Norwegian municipalities, taken from Geonorge, so that you can draw them in ggplot2 with no geolibrary. Every municipality keeps its default position. The layout adds a magnified copy of the Oslo municipality in the blank area east of the mainland outline. This data is licensed under Creative Commons BY 4.0 (CC BY 4.0).

Usage

nor_municip_map_b2024_insert_oslo_dt

nor_municip_map_b2020_insert_oslo_dt

nor_municip_map_b2019_insert_oslo_dt

nor_municip_position_geolabels_b2024_insert_oslo_dt

nor_municip_position_geolabels_b2020_insert_oslo_dt

nor_municip_position_geolabels_b2019_insert_oslo_dt

Format

The three nor_municip_map_*_insert_oslo_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 group aesthetic in ggplot2. Several rings can share one location_code.

location_code

Municipality code (e.g. "municip_nor0301").

The three nor_municip_position_geolabels_*_insert_oslo_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 30659 rows and 5 columns.

An object of class data.table (inherits from data.frame) with 31763 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 carry the same Haram gap as the default layout; see nor_municip_map_bxxxx_default_dt.

Oslo therefore appears twice. Both copies keep location_code == "municip_nor0301". The magnified copy takes group levels that start with "x". It spans longitude 17.99 to 23.08 and latitude 60.39 to 63.96. It is the municipality outline, not the 15 city wards; for those, see oslo_ward_map_bxxxx_default_dt. Pair the dataset with nor_xxx_position_title_insert_oslo_bxxxx_insert_oslo_dt, which holds the coordinate for an "Oslo" caption above the magnified copy.

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("layout", package = "csmaps") explains the insert-Oslo layout, but draws it with the county map. No vignette uses a municipality insert-Oslo dataset.

Other municipality maps: nor_municip_map_bxxxx_default_dt, nor_municip_map_bxxxx_default_sf, nor_municip_map_bxxxx_split_dt

Other insert-Oslo layout datasets: nor_county_map_bxxxx_insert_oslo_dt, nor_xxx_position_title_insert_oslo_bxxxx_insert_oslo_dt

Examples

# 2024 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + geom_polygon(
  data = csmaps::nor_municip_map_b2024_insert_oslo_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.2
)
q <- q + annotate(
  "text",
  x = csmaps::nor_xxx_position_title_insert_oslo_b2024_insert_oslo_dt$long,
  y = csmaps::nor_xxx_position_title_insert_oslo_b2024_insert_oslo_dt$lat,
  label = "Oslo"
)
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_insert_oslo_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.2
)
q <- q + annotate(
  "text",
  x = csmaps::nor_xxx_position_title_insert_oslo_b2020_insert_oslo_dt$long,
  y = csmaps::nor_xxx_position_title_insert_oslo_b2020_insert_oslo_dt$lat,
  label = "Oslo"
)
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_insert_oslo_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.2
)
q <- q + annotate(
  "text",
  x = csmaps::nor_xxx_position_title_insert_oslo_b2019_insert_oslo_dt$long,
  y = csmaps::nor_xxx_position_title_insert_oslo_b2019_insert_oslo_dt$lat,
  label = "Oslo"
)
q <- q + theme_void()
q <- q + coord_quickmap()
q