-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.qmd
35 lines (27 loc) · 1.11 KB
/
README.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
---
title: Boundaries
format: gfm
message: false
warning: false
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
sf::sf_use_s2(FALSE)
```
This repo uses premade lookup tables to generate boundary data files used by Active Travel England.
See the `.qmd` files for reproducible source code.
Regenerate the boundary files using the following code:
```{r}
lad_to_lta_lookup = readr::read_csv("./local_authority_district_to_local_transport_authority_lookup.csv")
local_authority_geometries = sf::read_sf("https://services1.arcgis.com/ESMARspQHYMw9BZ9/arcgis/rest/services/Local_Authority_Districts_May_2023_UK_BUC_V2/FeatureServer/0/query?outFields=*&where=1%3D1&f=geojson")
local_authority_geometries_joined = dplyr::left_join(local_authority_geometries, lad_to_lta_lookup)
ltas = local_authority_geometries_joined |>
dplyr::group_by(LTA23NM) |>
dplyr::summarise(local_authority_names = paste0(LAD23NM, collapse = ", ")) |>
dplyr::filter(LTA23NM != "")
plot(ltas$geometry)
```
```{r}
sf::write_sf(ltas, "./transport_authorities.geojson", delete_dsn = TRUE)
fs::file_size("./transport_authorities.geojson")
```