get_shapefile: Download shapefile for mapping

Description Usage Arguments Details Examples

View source: R/utils.r

Description

Downloads the highest resolution shapefiles for several common boundaries (see below for list).

Usage

1
get_shapefile(boundary, type = "extent", path = "./shp")

Arguments

boundary

character string, specifies what boundary you want. Available options are 'ltla' (Lower Tier Local Authorities), 'ccg' (Clinical Commissioning Groups), 'stp' (Sustainability & Transformation Partnerships), 'msoa' (Middle Super Output Areas), and 'lsoa' (Lower Super Output Areas)

type

character string, specifies what type of shapefile you want. Available options are 'extent' (Extent Of The Realm), or 'clipped' (Clipped to the coastline)

path

character string, specifies where the shapefile will be saved. By default shapefiles will be saved in a ./shp directory

Details

Two types of shapefile are available for download - 'extent of the realm' and 'clipped to the coastline'. Extent of the realm should be used for any GIS work (computing areas of regions, for example), and clipped to the coastline should be used for mapping & visualisation. Both types look very similar, maps produced using extent of the realm shapefiles will be almost identical to maps produced using clipped to the coastline shapefiles.

Extent of the realm shapefiles are downloaded by default. Clipped to the coastline shapefiles are needed if you are overlaying other map visuals (OSM, ordnance survey, etc).

Examples

1
2
3
4
5
6
7
8
# Get extent of the realm LSOAs (large file - may take a while to download)
get_shapefile(boundary = 'lsoa')

# Get clipped CCGs
get_shapefile(boundary = 'ccg', type = 'clipped')

# Get clipped MSOAs, save to current directory
get_shapefile(boundary = 'msoa', type = 'clipped', path = '.')

sm212/maguiR documentation built on May 31, 2020, 2:40 p.m.