Skip to content

My own version of maps based on shapefiles from OSi and OSNI

Notifications You must be signed in to change notification settings

brendanjodowd/maps

Repository files navigation

🌐 maps

A bank of maps in geojson format which can be used in R. While they are given as a collection of local electoral areas or electoral divisions, they can be very easily aggregated up to produce shapes for counties, administrative areas, NUTS2 and NUTS3 regions. They include

lea_166 is the current set of 166 local electoral areas, plus Northern Ireland.

lea_137 is the old set of 137 local electoral areas which was used at the time of the last Census in 2016, plus Northern Ireland.

ed_3441 and ed_3409 are two maps for electoral divisions with 3,441 and 3,409 individual regions (plus Northern Ireland), since different datasets use different aggregations of the electoral divisions.

🙋 How to use

You can import the maps directly from the web using st_read:

lea_166 <- st_read("https://raw.githubusercontent.com/brendanjodowd/maps/main/lea_166.geojson")
lea_137 <- st_read("https://raw.githubusercontent.com/brendanjodowd/maps/main/lea_137.geojson")
ed_3441 <- st_read("https://raw.githubusercontent.com/brendanjodowd/maps/main/ed_3441.geojson")
ed_3409 <- st_read("https://raw.githubusercontent.com/brendanjodowd/maps/main/ed_3409.geojson")

The st_read() function (part of the sf package for R) turns the geojson object into an sf (simple features) object. An sf object is a data-frame-like object which is integrable with tidyverse and the ggplot2 plotting system. For example, you can join each of these maps to other datasets using full_join(), or you can plot it using ggplot(lea_166) + geom_sf(). Two useful guides from Jesse Sadler on GIS in R and simple feature structure may be of use.

✨ Features

  • Shannon esturary is clipped out of shapes.
  • Regions can be easily aggregated up to produce counties, admin areas, NUTS2 and NUTS3 regions, with full nesting.
  • Northern Ireland outline included
  • Includes cso_name variable for LEAs and EDs, which allows easy linking to CSO PxStat files,
  • Includes hp_name variable for LEAs for lea_137 and ed_3409, which allows easy linking to Pobal HP data.

🧩 Aggregating up for counties and NUTS regions

Maps for counties, admin areas, NUTS2 and NUTS3 regions can be produced using either of the shapefiles provided. To produce a map of counties, for example, use:

county_map <- lea_166 %>% group_by(COUNTY) %>% summarise(geometry = st_union(geometry) , AREA=sum(AREA))

👩‍🏫 Example

See sample_map.R for code. Uses Pobal HP data from here. With thanks to David Wachsmuth for this useful blog post.

sample_map

🌱 Data sources

The maps are based on open data maps from Ordnance Survey Ireland (OSi) and Ordnance Survey of Northern Ireland (OSNI), and manipulated using tools including the rmapshaper package. The OSi maps are available under the Creative Commons Attribution 4.0 Licence, while the OSNI maps are available under the UK Open Government Licence. Both of these licences allow the sharing and manipuation of this data provided that the source is acknowledged.

Sources of shapefiles:

About

My own version of maps based on shapefiles from OSi and OSNI

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages