Skip to contents

read_sf downloads boundaries from the ONS Open Geography Portal.

Usage

read_sf(
  geog,
  year = 2021,
  nations = c("E", "S", "W", "N"),
  type = "BGC",
  crs = 4326
)

Arguments

geog

Type of boundaries

Administrative Boundaries available:

- Countries/Nations ("NAT")

- Regions (England ONLY) ("GOR")

- Upper Tier Local Authorities ("UTLA")

- Lower Tier Local Authorities ("LAD")

Census Boundaries available:

- Output Area ("OA")

- Lower Super Output Area ("LSOA")

- Middle Super Output Area ("MSOA")

Electoral Boundaries available:

- Westminster Parliamentary Constituencies ("WM")

- European Union Parliamentary Constituencies ("EU")

- Welsh Assembly Constituencies ("WAC")

- Welsh Assembly Regions ("WAR")

Eurostat NUTS Boundaries available:

- NUTS Level 1 (NUTS1)

- NUTS Level 2 (NUTS2)

- NUTS Level 3 (NUTS3)

year

Year (use available_sf() to see available years for each set of boundaries)

nations

For which UK nations (c("E","W","S","N"))

type

Boundary clipping

- "BFE": Full Resolution Extent of the Realm (Low Tide)

- "BFC": Full Resolution Clipped (High Tide)

- "BGC": Generalised (20m) Clipped (High Tide)

- "BUC": Ultra Generalised (500m) Clipped (High Tide)

crs

Coordinate Reference System (ESPG).

It is recommend to use 4326 (World Geodetic System) or potentially 27700 (UK OS British National Grid)

Value

Output is a simple feature sf object containing the relevant boundaries.

Examples

read_sf("NAT")
#> Simple feature collection with 4 features and 11 fields
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -8.649996 ymin: 49.86479 xmax: 1.763706 ymax: 60.86078
#> Geodetic CRS:  WGS 84
#>          cd               nm          ctry21n  bng_e  bng_n     long      lat
#> 1 E92000001          England           Lloegr 394883 370883 -2.07811 53.23497
#> 2 N92000002 Northern Ireland Gogledd Iwerddon  86544 535337 -6.85570 54.61501
#> 3 S92000003         Scotland         Yr Alban 277744 700060 -3.97094 56.17743
#> 4 W92000004            Wales            Cymru 263405 242881 -3.99417 52.06741
#>   objectd  st_ln__      st_r_s_          country                       geometry
#> 1       1 12457826 130457695413          England MULTIPOLYGON (((0.1317464 5...
#> 2       2  1048307  14330039999 Northern Ireland MULTIPOLYGON (((-6.481663 5...
#> 3       3 17029774  78795447769         Scotland MULTIPOLYGON (((-3.373745 5...
#> 4       4  3027839  20782249641            Wales MULTIPOLYGON (((-3.308212 5...
read_sf("MSOA", year = 2011)
#> Simple feature collection with 7201 features and 7 fields
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -6.418524 ymin: 49.86474 xmax: 1.762942 ymax: 55.81107
#> Geodetic CRS:  WGS 84
#> First 10 features:
#>    id        cd                  mso11nm                  ms11nmw st_r_s_
#> 1   1 E02000001       City of London 001       City of London 001 2905399
#> 2   2 E02000002 Barking and Dagenham 001 Barking and Dagenham 001 2165634
#> 3   3 E02000003 Barking and Dagenham 002 Barking and Dagenham 002 2143565
#> 4   4 E02000004 Barking and Dagenham 003 Barking and Dagenham 003 2490215
#> 5   5 E02000005 Barking and Dagenham 004 Barking and Dagenham 004 1186180
#> 6   6 E02000007 Barking and Dagenham 006 Barking and Dagenham 006 1733916
#> 7   7 E02000008 Barking and Dagenham 007 Barking and Dagenham 007 1419309
#> 8   8 E02000009 Barking and Dagenham 008 Barking and Dagenham 008  965622
#> 9   9 E02000010 Barking and Dagenham 009 Barking and Dagenham 009 1120326
#> 10 10 E02000011 Barking and Dagenham 010 Barking and Dagenham 010 1602157
#>     st_ln__ country                       geometry
#> 1  9024.060 England MULTIPOLYGON (((-0.09675966...
#> 2  8152.698 England MULTIPOLYGON (((0.1481122 5...
#> 3  9118.449 England MULTIPOLYGON (((0.150653 51...
#> 4  8207.610 England MULTIPOLYGON (((0.1851074 5...
#> 5  6964.962 England MULTIPOLYGON (((0.1499051 5...
#> 6  6773.957 England MULTIPOLYGON (((0.1600451 5...
#> 7  8427.797 England MULTIPOLYGON (((0.136055 51...
#> 8  5958.160 England MULTIPOLYGON (((0.1169839 5...
#> 9  7651.809 England MULTIPOLYGON (((0.156482 51...
#> 10 7770.863 England MULTIPOLYGON (((0.1656968 5...
read_sf("EU", year = 2018, type = "BFC")
#> Simple feature collection with 12 features and 10 fields
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -8.649996 ymin: 49.86468 xmax: 1.763571 ymax: 60.86079
#> Geodetic CRS:  WGS 84
#> First 10 features:
#>    id        cd                  eer18nm  bng_e  bng_n      long      lat
#> 1   1 E15000001               North East 417313 600358 -1.728900 55.29703
#> 2   2 E15000002               North West 350015 506280 -2.772370 54.44945
#> 3   3 E15000003 Yorkshire and The Humber 446903 448736 -1.287120 53.93264
#> 4   4 E15000004            East Midlands 477660 322635 -0.849670 52.79572
#> 5   5 E15000005            West Midlands 386294 295477 -2.203580 52.55697
#> 6   6 E15000006                  Eastern 571074 263229  0.504146 52.24067
#> 7   7 E15000007                   London 517516 178392 -0.308640 51.49227
#> 8   8 E15000008               South East 470062 172924 -0.993110 51.45097
#> 9   9 E15000009               South West 285015 102567 -3.633430 50.81119
#> 10 10 N07000001         Northern Ireland  86601 535325 -6.854810 54.61494
#>        st_r_s_   st_ln__          country                       geometry
#> 1   8592429309 1008417.3          England MULTIPOLYGON (((-2.024151 5...
#> 2  14164090946 2075329.2          England MULTIPOLYGON (((-2.675591 5...
#> 3  15409123400 1385386.8          England MULTIPOLYGON (((-0.7907309 ...
#> 4  15643271943 1332321.1          England MULTIPOLYGON (((-0.2997642 ...
#> 5  13003737759  953904.5          England MULTIPOLYGON (((-1.958916 5...
#> 6  19135563220 2646529.1          England MULTIPOLYGON (((0.9906409 5...
#> 7   1573509571  420201.1          England MULTIPOLYGON (((-0.0968623 ...
#> 8  19088242760 2460926.1          England MULTIPOLYGON (((-0.6821292 ...
#> 9  23851369852 3400336.0          England MULTIPOLYGON (((-1.762504 5...
#> 10 14333249704 1143121.8 Northern Ireland MULTIPOLYGON (((-6.482114 5...
read_sf("NUTS1", year = 2018, nations = "E")
#> Simple feature collection with 9 features and 10 fields
#> Geometry type: MULTIPOLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -6.418622 ymin: 49.86474 xmax: 1.763571 ymax: 55.81107
#> Geodetic CRS:  WGS 84
#>   id  cd                  nts118n  bng_e  bng_n      long      lat     st_r_s_
#> 1  1 UKC     North East (England) 417313 600358 -1.728900 55.29703  8592514533
#> 2  2 UKD     North West (England) 350015 506280 -2.772370 54.44945 14163828445
#> 3  3 UKE Yorkshire and The Humber 446903 448736 -1.287120 53.93264 15409346548
#> 4  4 UKF  East Midlands (England) 477660 322635 -0.849670 52.79572 15643166718
#> 5  5 UKG  West Midlands (England) 386294 295477 -2.203580 52.55697 13003726932
#> 6  6 UKH          East of England 571074 263229  0.504146 52.24067 19134639812
#> 7  7 UKI                   London 517516 178392 -0.308640 51.49227  1573498439
#> 8  8 UKJ     South East (England) 470062 172924 -0.993110 51.45097 19088634620
#> 9  9 UKK     South West (England) 285015 102567 -3.633430 50.81119 23851849460
#>     st_ln__ country                       geometry
#> 1  983195.8 England MULTIPOLYGON (((-2.029408 5...
#> 2 1986497.8 England MULTIPOLYGON (((-2.676443 5...
#> 3 1358823.1 England MULTIPOLYGON (((-0.792227 5...
#> 4 1297836.9 England MULTIPOLYGON (((-0.3009304 ...
#> 5  921187.1 England MULTIPOLYGON (((-1.950726 5...
#> 6 2492564.9 England MULTIPOLYGON (((1.015736 52...
#> 7  409656.3 England MULTIPOLYGON (((-0.09953576...
#> 8 2341969.8 England MULTIPOLYGON (((-0.6846535 ...
#> 9 3189137.2 England MULTIPOLYGON (((-1.757683 5...

if (FALSE) {
read_sf("UTLA", nations = c("E","W"))
read_elec("WM")
}