GithubHelp home page GithubHelp logo

maps's Introduction

๐ŸŒ 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:

maps's People

Contributors

brendanjodowd avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.