A R data package of Swedish historical administrative boundaries for parishes and counties 1600-1990. Municipal, Pastorship, Parish, Bailiwick, Contract, Magistrates court, Hundred, District court, County, Diocese and Court.
Based upon historical GIS data from the Swedish National Archive. Data on parishes and counties has been verified, while the other types of units have not. Thus, be aware of possible inconsistencies and faults.
"Historiska GIS-kartor (information om territoriella indelningar i Sverige från 1500-talets slut till 1900-talets slut)" historical GIS data from the Swedish National Archive released under Creative Commons CCZero.
The map projection is SWEREF99 EPSG:3006
library(histmaps) library(sf) library(tidyverse) map <- get_boundaries(1800, "county") plot(st_geometry(map))
Meta data for parishes and counties are collected in a separate file.
data("geom_meta") geom_meta %>% filter(type_id == "parish") %>% head() %>% knitr::kable()
Meta data wich can be used to easly subset data, for example by county.
p_map <- get_boundaries("1866", "parish") st_map <- p_map %>% left_join(geom_meta, by = c("geom_id")) st_map %>% filter(county == 25) %>% ggplot() + geom_sf(fill = "lightgrey", color = "black") + theme_minimal()
As parishes changes boundaries over the course of history a given map a certain year is not representative of the boundaries another year. To create a map for a period the parishes need to be aggregated to the lowest common denominator for that period. You can do this by supplying a date range to get_boundaries
.
period_map <- get_boundaries(c(1900, 1920), type = "parish")
The function returns a list where the first object is the map data and the second is a lookup-table for aggregating your data to the new artificial parish boundaries.
plot(st_geometry(period_map$map))
knitr::kable(head(period_map$lookup))
data("geom_borders") st_map_borders <- geom_borders %>% filter(start <= 1866, end >= 1866) %>% left_join(geom_meta, by = c("geom_id")) ggplot() + geom_sf(data = st_map %>% filter(county == 22), color = NA) + geom_sf(data = st_map_borders %>% filter(county == 22)) + theme_minimal()
data("eu_geom") data("eu_border") eu_1900 <- eu_geom %>% filter(year == 1900) %>% st_transform(st_crs(map)) eu_border_1900 <- eu_border %>% filter(year == 1900)%>% st_transform(st_crs(map)) county_map <- geom_borders %>% filter(start <= 1900, end >= 1900, type_id == "county") lims <- st_bbox(map) ggplot() + geom_sf(data = eu_1900, color = NA) + geom_sf(data =county_map, color = "gray60", size = .3) + geom_sf(data = eu_border_1900, color = "gray60") + coord_sf(xlim = lims[c(1,3)], ylim = lims[c(2,4)]) + theme_void() + theme(panel.background = element_rect(fill = "#9bbff4", color =NA))
library(leaflet) library(leafletwrapper) county_map <- get_boundaries(1900, "county") county_map <- county_map %>% left_join(geom_meta, by = "geom_id") data("hist_town") leaf_init() %>% leaf_polygon(county_map, interactive = T,lbl = "name.x") %>% leaf_marker(hist_town, interactive = T,lbl = "town")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.