Package 'csmaps'

Title: Preformatted Maps of Norway that Don't Need Geolibraries
Description: Provides datasets containing preformatted maps of Norway at the county, municipality, and ward (Oslo only) level for redistricting in 2024, 2020, 2018, and 2017. Multiple layouts are provided (normal, split, and with an insert for Oslo), allowing the user to rapidly create choropleth maps of Norway without any geolibraries.
Authors: Richard Aubrey White [aut, cre] (ORCID: <https://orcid.org/0000-0002-6747-1726>), Chi Zhang [aut] (ORCID: <https://orcid.org/0000-0003-0501-5909>), Folkehelseinstituttet [cph]
Maintainer: Richard Aubrey White <[email protected]>
License: MIT + file LICENSE
Version: 2026.8.22
Built: 2026-09-26 06:29:02 UTC
Source: https://github.com/niphr/csmaps

Help Index


Maps of Norwegian counties in data.table format

Description

We package the map datasets for Norwegian counties, 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_county_map_b2024_default_dt

nor_county_map_b2020_default_dt

nor_county_map_b2019_default_dt

nor_county_map_b2017_default_dt

nor_county_position_geolabels_b2024_default_dt

nor_county_position_geolabels_b2020_default_dt

nor_county_position_geolabels_b2019_default_dt

nor_county_position_geolabels_b2017_default_dt

Format

The four nor_county_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 group aesthetic in ggplot2. Several rings can share one location_code.

location_code

County code (e.g. "county_nor03").

The four nor_county_position_geolabels_*_default_dt datasets are data.tables with one row per county:

location_code

County code (e.g. "county_nor03").

long

Longitude in decimal degrees (WGS84) of the label anchor.

lat

Latitude in decimal degrees (WGS84) of the label anchor.

repel

Logical layout flag. Draw the TRUE rows with ggrepel::geom_label_repel() and the FALSE rows with ggplot2::geom_label().

An object of class data.table (inherits from data.frame) with 4479 rows and 5 columns.

An object of class data.table (inherits from data.frame) with 4722 rows and 5 columns.

An object of class data.table (inherits from data.frame) with 4531 rows and 5 columns.

An object of class data.table (inherits from data.frame) with 15 rows and 4 columns.

An object of class data.table (inherits from data.frame) with 11 rows and 4 columns.

An object of class data.table (inherits from data.frame) with 18 rows and 4 columns.

An object of class data.table (inherits from data.frame) with 19 rows and 4 columns.

Details

Borders for 2024, 2020, 2019, and 2017 are provided. The number of counties differs by border year: 15 in 2024, 11 in 2020, 18 in 2019, and 19 in 2017.

Each border year has a polygon table (nor_county_map_*) and a label table (nor_county_position_geolabels_*). The two hold the same set of location_code values, but different columns.

Source

Kartverket / Geonorge https://www.geonorge.no/. License: CC BY 4.0.

See Also

vignette("csmaps", package = "csmaps") draws this map, and vignette("layout", package = "csmaps") explains the naming scheme. Both use nor_county_map_b2024_default_dt. No vignette uses the 2020, 2019 or 2017 datasets, or any label dataset on this page.

Other county maps: nor_county_map_bxxxx_default_sf, nor_county_map_bxxxx_insert_oslo_dt, nor_county_map_bxxxx_split_dt

Examples

# 2024 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + geom_polygon(
  data = csmaps::nor_county_map_b2024_default_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
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_county_map_b2020_default_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
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_county_map_b2019_default_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
q <- q + theme_void()
q <- q + coord_quickmap()
q

# 2017 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + geom_polygon(
  data = csmaps::nor_county_map_b2017_default_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
q <- q + theme_void()
q <- q + coord_quickmap()
q

Maps of Norwegian counties in sf format

Description

We package the map datasets for Norwegian counties, taken from Geonorge, as simple features objects. They suit the sf package and ggplot2::geom_sf(). This data is licensed under Creative Commons BY 4.0 (CC BY 4.0).

Usage

nor_county_map_b2024_default_sf

nor_county_map_b2020_default_sf

nor_county_map_b2019_default_sf

nor_county_map_b2017_default_sf

Format

Each dataset is an sf data frame with one row per county:

geometry

MULTIPOLYGON geometry column. Geographic coordinates on WGS84 ("+proj=longlat +datum=WGS84 +no_defs"), which sf treats as equal to EPSG:4326. The objects carry no EPSG authority code, so sf::st_crs(x)$epsg is NA.

location_code

County code (e.g. "county_nor03").

An object of class sf (inherits from data.frame) with 11 rows and 2 columns.

An object of class sf (inherits from data.frame) with 18 rows and 2 columns.

An object of class sf (inherits from data.frame) with 19 rows and 2 columns.

Details

Borders for 2024, 2020, 2019, and 2017 are provided, in the default layout only. The number of counties differs by border year: 15 in 2024, 11 in 2020, 18 in 2019, and 19 in 2017.

Source

Kartverket / Geonorge https://www.geonorge.no/. License: CC BY 4.0.

See Also

vignette("sf_interactive", package = "csmaps") passes nor_county_map_b2024_default_sf to leaflet. No vignette uses the 2020, 2019 or 2017 sf datasets.

Other county maps: nor_county_map_bxxxx_default_dt, nor_county_map_bxxxx_insert_oslo_dt, nor_county_map_bxxxx_split_dt

Other sf maps: nor_municip_map_bxxxx_default_sf, oslo_ward_map_bxxxx_default_sf

Examples

library(ggplot2)
q <- ggplot(csmaps::nor_county_map_b2024_default_sf)
q <- q + geom_sf(fill = "white", color = "black", linewidth = 0.4)
q <- q + theme_void()
q

Maps of Norwegian counties with an insert for Oslo in data.table format

Description

We package the map datasets for Norwegian counties, taken from Geonorge, so that you can draw them in ggplot2 with no geolibrary. Every county keeps its default position. The layout adds a magnified copy of Oslo 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_county_map_b2024_insert_oslo_dt

nor_county_map_b2020_insert_oslo_dt

nor_county_map_b2019_insert_oslo_dt

nor_county_map_b2017_insert_oslo_dt

nor_county_position_geolabels_b2024_insert_oslo_dt

nor_county_position_geolabels_b2020_insert_oslo_dt

nor_county_position_geolabels_b2019_insert_oslo_dt

nor_county_position_geolabels_b2017_insert_oslo_dt

Format

The four nor_county_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

County code (e.g. "county_nor03").

The four nor_county_position_geolabels_*_insert_oslo_dt datasets are data.tables with one row per county:

location_code

County code (e.g. "county_nor03").

long

Longitude in decimal degrees (WGS84) of the label anchor.

lat

Latitude in decimal degrees (WGS84) of the label anchor.

repel

Logical layout flag. Draw the TRUE rows with ggrepel::geom_label_repel() and the FALSE rows with ggplot2::geom_label().

An object of class data.table (inherits from data.frame) with 4537 rows and 5 columns.

An object of class data.table (inherits from data.frame) with 4780 rows and 5 columns.

An object of class data.table (inherits from data.frame) with 4589 rows and 5 columns.

An object of class data.table (inherits from data.frame) with 15 rows and 4 columns.

An object of class data.table (inherits from data.frame) with 11 rows and 4 columns.

An object of class data.table (inherits from data.frame) with 18 rows and 4 columns.

An object of class data.table (inherits from data.frame) with 19 rows and 4 columns.

Details

Borders for 2024, 2020, 2019, and 2017 are provided. The number of counties differs by border year: 15 in 2024, 11 in 2020, 18 in 2019, and 19 in 2017.

Oslo therefore appears twice. Both copies keep location_code == "county_nor03". 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. Pair the dataset with nor_xxx_position_title_insert_oslo_bxxxx_insert_oslo_dt, which holds the coordinate for an "Oslo" caption above that copy.

Each border year has a polygon table (nor_county_map_*) and a label table (nor_county_position_geolabels_*). The two hold the same set of location_code values, but different columns.

Source

Kartverket / Geonorge https://www.geonorge.no/. License: CC BY 4.0.

See Also

vignette("layout", package = "csmaps") draws nor_county_map_b2024_insert_oslo_dt and explains the layout. No vignette uses the 2020, 2019 or 2017 datasets, or any label dataset on this page.

Other county maps: nor_county_map_bxxxx_default_dt, nor_county_map_bxxxx_default_sf, nor_county_map_bxxxx_split_dt

Other insert-Oslo layout datasets: nor_municip_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_county_map_b2024_insert_oslo_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
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_county_map_b2020_insert_oslo_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
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_county_map_b2019_insert_oslo_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
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

# 2017 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + geom_polygon(
  data = csmaps::nor_county_map_b2017_insert_oslo_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
q <- q + annotate(
  "text",
  x = csmaps::nor_xxx_position_title_insert_oslo_b2017_insert_oslo_dt$long,
  y = csmaps::nor_xxx_position_title_insert_oslo_b2017_insert_oslo_dt$lat,
  label = "Oslo"
)
q <- q + theme_void()
q <- q + coord_quickmap()
q

Split map of Norwegian counties in data.table format

Description

We package the map datasets for Norwegian counties, taken from Geonorge, so that you can draw them in ggplot2 with no geolibrary. The split layout moves the far-northern counties down beside southern Norway. This cuts the whitespace that a full-length map leaves. The layout also adds a magnified copy of Oslo in the lower left. This data is licensed under Creative Commons BY 4.0 (CC BY 4.0).

Returns two ggplot2::annotate() layers. The first is a white rectangle that spans longitude 0.5 to 3.9 and latitude 58.9 to 61.4. The second is the text "Oslo" at longitude 2.2, latitude 59.15. Those bounds enclose the magnified Oslo copy in nor_county_map_b2024_split_dt and nor_county_map_b2020_split_dt. Add the list to a ggplot2 plot with +, before the geom_polygon() that draws the map.

Usage

nor_county_map_b2024_split_dt

nor_county_map_b2020_split_dt

nor_county_position_geolabels_b2024_split_dt

nor_county_position_geolabels_b2020_split_dt

annotate_oslo_nor_map_bxxxx_split_dt()

Format

nor_county_map_b2024_split_dt and nor_county_map_b2020_split_dt 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

County code (e.g. "county_nor03").

nor_county_position_geolabels_b2024_split_dt and nor_county_position_geolabels_b2020_split_dt are data.tables with one row per county:

location_code

County code (e.g. "county_nor03").

long

Longitude in decimal degrees (WGS84) of the label anchor.

lat

Latitude in decimal degrees (WGS84) of the label anchor.

repel

Logical layout flag. Draw the TRUE rows with ggrepel::geom_label_repel() and the FALSE rows with ggplot2::geom_label().

An object of class data.table (inherits from data.frame) with 4537 rows and 5 columns.

An object of class data.table (inherits from data.frame) with 15 rows and 4 columns.

An object of class data.table (inherits from data.frame) with 11 rows and 4 columns.

Details

Borders for 2024 (15 counties) and 2020 (11 counties) are provided. The 2024 layout moves Nordland (county_nor18), Troms (county_nor55) and Finnmark (county_nor56). The 2020 layout moves Nordland (county_nor18) and Troms og Finnmark (county_nor54). Every other county keeps its default coordinates. The package holds no Svalbard or Jan Mayen polygons, in this layout or any other.

Oslo appears twice. Both copies keep location_code == "county_nor03". The magnified copy takes group levels that start with "x". It spans longitude 0.74 to 3.52 and latitude 59.30 to 61.24. Draw a box and caption around it with annotate_oslo_nor_map_bxxxx_split_dt().

Each border year has a polygon table (nor_county_map_*) and a label table (nor_county_position_geolabels_*). The two hold the same set of location_code values, but different columns.

The municipality split maps carry no magnified Oslo copy, so this annotation draws an empty box on them.

Value

A list of two ggplot2 layer objects (a rectangle and a text annotation). Add the list directly to a ggplot with +.

Source

Kartverket / Geonorge https://www.geonorge.no/. License: CC BY 4.0.

See Also

vignette("layout", package = "csmaps") draws nor_county_map_b2024_split_dt, and vignette("customization", package = "csmaps") colours it and labels it with nor_county_position_geolabels_b2024_split_dt. No vignette uses the 2020 datasets.

Other county maps: nor_county_map_bxxxx_default_dt, nor_county_map_bxxxx_default_sf, nor_county_map_bxxxx_insert_oslo_dt

Examples

# 2024 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + csmaps::annotate_oslo_nor_map_bxxxx_split_dt()
q <- q + geom_polygon(
  data = csmaps::nor_county_map_b2024_split_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
q <- q + theme_void()
q <- q + coord_quickmap()
q

# 2024 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + csmaps::annotate_oslo_nor_map_bxxxx_split_dt()
q <- q + geom_polygon(
  data = csmaps::nor_county_map_b2024_split_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
q <- q + ggrepel::geom_label_repel(
  data = csmaps::nor_county_position_geolabels_b2024_split_dt[repel==TRUE],
  mapping = aes(x = long, y = lat, label = location_code),
  size = 3,
  label.size = 0.1,
  label.r = grid::unit(0, "lines"),
  min.segment.length = 0
)
q <- q + geom_label(
  data = csmaps::nor_county_position_geolabels_b2024_split_dt[repel==FALSE],
  mapping = aes(x = long, y = lat, label = location_code),
  size = 3,
  label.size = 0.1,
  label.r = grid::unit(0, "lines")
)
q <- q + theme_void()
q <- q + coord_quickmap()
q

# 2020 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + csmaps::annotate_oslo_nor_map_bxxxx_split_dt()
q <- q + geom_polygon(
  data = csmaps::nor_county_map_b2020_split_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
q <- q + theme_void()
q <- q + coord_quickmap()
q

Maps of Norwegian municipalities in data.table format

Description

We 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_dt

Format

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 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_*_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.

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.

Source

Kartverket / Geonorge https://www.geonorge.no/. License: CC BY 4.0.

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

Maps of Norwegian municipalities in sf format

Description

We package the map datasets for Norwegian municipalities, taken from Geonorge, as simple features objects. They suit the sf package and ggplot2::geom_sf(). This data is licensed under Creative Commons BY 4.0 (CC BY 4.0).

Usage

nor_municip_map_b2024_default_sf

nor_municip_map_b2020_default_sf

nor_municip_map_b2019_default_sf

Format

Each dataset is an sf data frame with one row per municipality:

geometry

MULTIPOLYGON geometry column. Geographic coordinates on WGS84 ("+proj=longlat +datum=WGS84 +no_defs"), which sf treats as equal to EPSG:4326. The objects carry no EPSG authority code, so sf::st_crs(x)$epsg is NA.

location_code

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

An object of class sf (inherits from data.frame) with 356 rows and 2 columns.

An object of class sf (inherits from data.frame) with 422 rows and 2 columns.

Details

Borders for 2024, 2020, and 2019 are provided, in the default layout only, holding 356, 356 and 422 municipalities respectively. The 2024 datasets carry the same Haram gap as the data.table versions; see nor_municip_map_bxxxx_default_dt.

Source

Kartverket / Geonorge https://www.geonorge.no/. License: CC BY 4.0.

See Also

vignette("sf_interactive", package = "csmaps") shows the sf-plus- leaflet workflow, but on the county sf dataset. No vignette uses a municipality sf dataset.

Other municipality maps: nor_municip_map_bxxxx_default_dt, nor_municip_map_bxxxx_insert_oslo_dt, nor_municip_map_bxxxx_split_dt

Other sf maps: nor_county_map_bxxxx_default_sf, oslo_ward_map_bxxxx_default_sf

Examples

library(ggplot2)
q <- ggplot(csmaps::nor_municip_map_b2024_default_sf)
q <- q + geom_sf(fill = "white", color = "black", linewidth = 0.2)
q <- q + theme_void()
q

Maps of Norwegian municipalities with an insert for Oslo in data.table format

Description

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.

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.

Source

Kartverket / Geonorge https://www.geonorge.no/. License: CC BY 4.0.

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

Split map of Norwegian municipalities in data.table format

Description

We package the map datasets for Norwegian municipalities, taken from Geonorge, so that you can draw them in ggplot2 with no geolibrary. The split layout moves the far-northern municipalities down beside southern Norway. This cuts the whitespace that a full-length map leaves. This data is licensed under Creative Commons BY 4.0 (CC BY 4.0).

Usage

nor_municip_map_b2024_split_dt

nor_municip_map_b2020_split_dt

Format

Both 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").

An object of class data.table (inherits from data.frame) with 30601 rows and 5 columns.

Details

Borders for 2024 and 2020 are provided, each holding 356 municipalities. Both layouts move 80 of them. In 2024 those are the municipalities of Nordland (codes municip_nor18xx), Troms (municip_nor55xx) and Finnmark (municip_nor56xx). In 2020 they are Nordland (municip_nor18xx) and Troms og Finnmark (municip_nor54xx). Every other municipality keeps its default coordinates. The package holds no Svalbard or Jan Mayen polygons, in this layout or any other.

Unlike the county split maps, these datasets hold no magnified copy of Oslo, so annotate_oslo_nor_map_bxxxx_split_dt() would draw an empty box on them. There is no matching nor_municip_position_geolabels_*_split_dt label dataset.

The 2024 datasets carry the same Haram gap as the default layout; see nor_municip_map_bxxxx_default_dt.

Source

Kartverket / Geonorge https://www.geonorge.no/. License: CC BY 4.0.

See Also

vignette("layout", package = "csmaps") explains the split layout, but draws it with the county map. No vignette uses a municipality split dataset.

Other municipality maps: nor_municip_map_bxxxx_default_dt, nor_municip_map_bxxxx_default_sf, nor_municip_map_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_split_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_split_dt,
  mapping = aes(group = group),
  color = "black",
  fill = "white",
  linewidth = 0.2
)
q <- q + theme_void()
q <- q + coord_quickmap()
q

Position of the "Oslo" title label for the insert-Oslo map layout

Description

A single-row data.table giving the longitude/latitude coordinates at which the "Oslo" text label should be placed when using an _insert_oslo map dataset.

Usage

nor_xxx_position_title_insert_oslo_b2024_insert_oslo_dt

nor_xxx_position_title_insert_oslo_b2020_insert_oslo_dt

nor_xxx_position_title_insert_oslo_b2019_insert_oslo_dt

nor_xxx_position_title_insert_oslo_b2017_insert_oslo_dt

Format

Each dataset is a one-row data.table:

long

Longitude in decimal degrees (WGS84) for the label anchor.

lat

Latitude in decimal degrees (WGS84) for the label anchor.

An object of class data.table (inherits from data.frame) with 1 rows and 2 columns.

An object of class data.table (inherits from data.frame) with 1 rows and 2 columns.

An object of class data.table (inherits from data.frame) with 1 rows and 2 columns.

Details

Datasets are provided for 2024, 2020, 2019 and 2017. All four are identical, because the magnified Oslo copy sits in the same place in every insert-Oslo map. Each holds the single coordinate longitude 19.75, latitude 64.5. That coordinate is above the magnified copy, which spans longitude 17.99 to 23.08 and latitude 60.39 to 63.96.

The label is granularity-free, which is what xxx in the name means: the same coordinate serves the county and the municipality insert-Oslo maps.

Source

Derived from the insert-Oslo layout coordinates; no external source.

See Also

vignette("layout", package = "csmaps") places this label on nor_county_map_b2024_insert_oslo_dt. No vignette uses the 2020, 2019 or 2017 datasets.

Other insert-Oslo layout datasets: nor_county_map_bxxxx_insert_oslo_dt, nor_municip_map_bxxxx_insert_oslo_dt

Examples

# 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.4
)
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

Map of Oslo wards (bydeler) in data.table format

Description

We package the map datasets for Oslo wards (bydeler), taken from Oslo municipality, 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

oslo_ward_map_b2024_default_dt

oslo_ward_map_b2020_default_dt

oslo_ward_position_geolabels_b2024_default_dt

oslo_ward_position_geolabels_b2020_default_dt

Format

oslo_ward_map_b2024_default_dt and oslo_ward_map_b2020_default_dt 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.

group

Factor, one level per closed polygon ring; use as the group aesthetic in ggplot2. Here each ward has exactly one ring.

location_code

Ward code (e.g. "wardoslo_nor030101").

oslo_ward_position_geolabels_b2024_default_dt and oslo_ward_position_geolabels_b2020_default_dt are data.tables with one row per ward. They carry no repel column, unlike the county label datasets:

location_code

Ward code (e.g. "wardoslo_nor030101").

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 1372 rows and 5 columns.

An object of class data.table (inherits from data.frame) with 15 rows and 3 columns.

An object of class data.table (inherits from data.frame) with 15 rows and 3 columns.

Details

Borders provided for 2024, 2020. Both hold the 15 wards wardoslo_nor030101 to wardoslo_nor030115, one closed polygon ring each. The 2024 and 2020 objects are identical, for the maps and for the label datasets alike. Only the default layout is provided; there is no insert-Oslo or split ward map.

Each border year has a polygon table (oslo_ward_map_*) and a label table (oslo_ward_position_geolabels_*). The two hold the same set of location_code values, but different columns.

Source

Oslo kommune. License: CC BY 4.0.

See Also

vignette("layout", package = "csmaps") draws oslo_ward_map_b2024_default_dt, and vignette("customization", package = "csmaps") labels it with oslo_ward_position_geolabels_b2024_default_dt. No vignette uses the 2020 datasets.

Other Oslo ward maps: oslo_ward_map_bxxxx_default_sf

Examples

# 2024 borders
library(ggplot2)
q <- ggplot(mapping = aes(x = long, y = lat))
q <- q + geom_polygon(
  data = csmaps::oslo_ward_map_b2024_default_dt,
  mapping = aes(group = group, fill = location_code),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
q <- q + geom_label(
  data = csmaps::oslo_ward_position_geolabels_b2024_default_dt,
  mapping = aes(label = location_code),
  color = "red"
)
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::oslo_ward_map_b2020_default_dt,
  mapping = aes(group = group, fill = location_code),
  color = "black",
  fill = "white",
  linewidth = 0.4
)
q <- q + geom_label(
  data = csmaps::oslo_ward_position_geolabels_b2020_default_dt,
  mapping = aes(label = location_code),
  color = "red"
)
q <- q + theme_void()
q <- q + coord_quickmap()
q

Map of Oslo wards (bydeler) in sf format

Description

We package the map datasets for Oslo wards (bydeler), taken from Oslo municipality, as simple features objects. They suit the sf package and ggplot2::geom_sf(). This data is licensed under Creative Commons BY 4.0 (CC BY 4.0).

Usage

oslo_ward_map_b2020_default_sf

oslo_ward_map_b2024_default_sf

Format

Each dataset is an sf data frame with one row per ward:

geometry

MULTIPOLYGON geometry column. Geographic coordinates on WGS84 ("+proj=longlat +datum=WGS84 +no_defs"), which sf treats as equal to EPSG:4326. The objects carry no EPSG authority code, so sf::st_crs(x)$epsg is NA.

location_code

Ward code (e.g. "wardoslo_nor030101").

An object of class sf (inherits from data.frame) with 15 rows and 2 columns.

Details

Borders provided for 2024, 2020, in the default layout only. Both hold the 15 wards wardoslo_nor030101 to wardoslo_nor030115, and the two objects are identical.

Source

Oslo kommune. License: CC BY 4.0.

See Also

vignette("sf_interactive", package = "csmaps") shows the sf-plus- leaflet workflow, but on the county sf dataset. No vignette uses an Oslo ward sf dataset.

Other Oslo ward maps: oslo_ward_map_bxxxx_default_dt

Other sf maps: nor_county_map_bxxxx_default_sf, nor_municip_map_bxxxx_default_sf

Examples

library(ggplot2)
q <- ggplot(csmaps::oslo_ward_map_b2024_default_sf)
q <- q + geom_sf(fill = "white", color = "black", linewidth = 0.4)
q <- q + theme_void()
q