Skip to content

Commit

Permalink
Add November 22nd's blog
Browse files Browse the repository at this point in the history
  • Loading branch information
charliejhadley committed Nov 29, 2024
1 parent 3456a21 commit 43c8efe
Show file tree
Hide file tree
Showing 13 changed files with 345 additions and 228 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"hash": "b6c27b9a16c32237f3c1e6413094e1ae",
"hash": "33a8d7e746a46111239cec49685e4013",
"result": {
"engine": "knitr",
"markdown": "---\ntitle: \"Star Trekking in Trek\"\ndate: '2024-11-08'\ndraft: true\nexecute:\n freeze: true\n message: false\n warning: false\n echo: false\n eval: false\ncode-fold: false\nengine: knitr\nfilters:\n - line-highlight\n---\n\n\n\n\n\n\nI've been looking for an opportunity to experiment with charts that use glow to expose borders and stumbled on the idea of visualising UK motorways via the service stations. Let's get going with the datasets I'll need.\n\n## UK Road Network\n\nThe Ordance Survey makes available a huge dataset containing UK roads. Let's download, unzip and read in the road links. Please note this generates an `{sf}` object that's >4Gb in size.\n\n\n\n\n::: {.cell}\n\n:::\n\n\n\n\nWhat kinds of road do we have?\n\n\n\n\n::: {.cell}\n\n:::\n\n\n\n\nLet's extract out the motorways and see if we can visualise them.\n\n\n\n\n::: {.cell}\n\n:::\n\n\n\n\n### Great Britain mainland\n\nI'm interested in looking at only the mainland of Great Britain. The ONS provides high quality data from here https://geoportal.statistics.gov.uk/datasets/ons::countries-december-2023-boundaries-uk-bfc-2/about. I'm going to extract the mainland by st_cast(\"POLYGON\") and discounting polygons with an area smaller than 2e10 m^2\n\n\n\n\n::: {.cell}\n\n:::\n\n::: {.cell}\n\n:::\n\n\n\n\n### Service stations\n\nI'm finding it harder to find a dataset of the motorway service station locations! I've manually downloaded files from https://www.motorwayservices.info/list/name and will extract info from them\n\n\n\n\n::: {.cell}\n\n:::\n",
"markdown": "---\ntitle: \"Beacons of restrooms\"\ndate: '2024-11-08'\ndraft: true\nexecute:\n freeze: true\n message: false\n warning: false\n echo: false\n eval: false\ncode-fold: false\nengine: knitr\nfilters:\n - line-highlight\n---\n\n\n\n\n\nI'm really interested in \n\n## UK Road Network\n\nThe Ordance Survey makes available a huge dataset containing UK roads. Let's download, unzip and read in the road links. Please note this generates an `{sf}` object that's >4Gb in size.\n\n\n\n::: {.cell}\n\n:::\n\n\n\nTo keep this folder small, let's delete the unused files\n\n\n\n::: {.cell}\n\n:::\n\n\n\n\nWhat kinds of road do we have?\n\n\n\n::: {.cell}\n\n:::\n\n\n\nLet's extract out the motorways and see if we can visualise them.\n\n\n\n::: {.cell}\n\n:::\n\n\n\n### Great Britain mainland\n\nI'm interested in looking at only the mainland of Great Britain. The ONS provides high quality data from here https://geoportal.statistics.gov.uk/datasets/ons::countries-december-2023-boundaries-uk-bfc-2/about. I'm going to extract the mainland by st_cast(\"POLYGON\") and discounting polygons with an area smaller than 2e10 m^2\n\n\n\n::: {.cell}\n\n:::\n\n::: {.cell}\n\n:::\n\n\n\n### Service stations\n\nI'm finding it harder to find a dataset of the motorway service station locations! I've manually downloaded files from https://www.motorwayservices.info/list/name and will extract info from them\n\n\n\n::: {.cell}\n\n:::\n",
"supporting": [],
"filters": [
"rmarkdown/pagebreak.lua"
Expand Down
74 changes: 51 additions & 23 deletions _site/blog.html

Large diffs are not rendered by default.

286 changes: 143 additions & 143 deletions _site/blog.xml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions _site/listings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{
"listing": "/blog.html",
"items": [
"/posts/2024-11-13_motorway-service-stations-info/index.html",
"/posts/2024-11-08_positives-and-negatives-lists/index.html",
"/posts/2024-11-08_curves-and-stones/index.html",
"/posts/2024-10-28_bordering-country-graph/index.html",
Expand Down
84 changes: 41 additions & 43 deletions _site/posts/2024-11-13_motorway-service-stations-info/index.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 64 additions & 1 deletion _site/search.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion _site/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@
</url>
<url>
<loc>https://visibledata.co.uk/posts/2024-11-08_curves-and-stones/index.html</loc>
<lastmod>2024-11-08T17:20:44.967Z</lastmod>
<lastmod>2024-11-10T17:46:35.697Z</lastmod>
</url>
<url>
<loc>https://visibledata.co.uk/posts/2024-11-13_motorway-service-stations-info/index.html</loc>
<lastmod>2024-11-24T11:54:40.151Z</lastmod>
</url>
</urlset>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 35 additions & 8 deletions posts/2024-11-13_motorway-service-stations-info/index.qmd
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
---
title: "Data Quest: Motorway Services UK"
date: '2024-11-08'
date: '2024-11-22'
execute:
freeze: true
message: false
warning: false
code-fold: true
engine: knitr
filters:
- line-highlight
---

```{r}
Expand Down Expand Up @@ -77,6 +75,37 @@ quarto_here("service-stations/Baldock Services A1(M) - Motorway Services Informa
data_raw_services <- list.files(quarto_here("service-stations/"), "[.]html", full.names = TRUE) %>%
map_dfr(~read_motorway_services_info(.x))
# For confusing reasons, Westmorland data is inconsistently collected.
# Happendon, Tebay, and Gloucester all have the same food retailers but only
# Gloucester has the data recorded. So let's add ot in manually.
data_manual_westermorland <- data_raw_services %>%
filter(service_station == "Gloucester Services Northbound M5",
property %in% c("Eat-In Food", "Takeaway Food / General")) %>%
mutate(service_station = c("Happendon Services M74|Tebay Services Northbound M6|Tebay Services Southbound M6")) %>%
separate_longer_delim(service_station,
delim= "|")
data_raw_services <- data_raw_services %>%
bind_rows(data_manual_westermorland)
data_raw_services %>%
filter(str_detect(service_station, "Tebay"))
# J38 Truckstop isn't really a service station!
data_raw_services <- data_raw_services %>%
filter(service_station != "J38 Truckstop M6")
# The Costas at Thurrock Services M25 and Trowell Services M1 have been accidentally ommitted.
data_raw_services <- data_raw_services %>%
bind_rows(tibble(
property = "Takeaway Food / General",
value = "Costa",
service_station = c("Thurrock Services M25", "Trowell Services M1")
))
```

## Northbound / Southbound and Eastbound / Westbound
Expand Down Expand Up @@ -170,12 +199,14 @@ fn_fix_value_columns <- function(data){
str_detect(tolower(value), "eat & drink co") ~ "Eat & Drink Co",
str_detect(tolower(value), "edc") ~ "Eat & Drink Co",
str_detect(tolower(value), "fone") ~ "FoneBiz",
str_detect(tolower(value), "full house") ~ "Full House",
str_detect(tolower(value), "food to go") ~ "Food to Go - Farm Cafe",
str_detect(tolower(value), "full house") ~ "Full House",
str_detect(tolower(value), "greg") ~ "Greggs",
str_detect(tolower(value), "harry") ~ "Harry Ramsden's",
str_detect(tolower(value), "hot food co") ~ "Hot Food Co",
str_detect(tolower(value), "krispy") ~ "Krispy Kreme",
str_detect(tolower(value), "le petit") ~ "Le Petit Four",
str_detect(tolower(value), "lp4") ~ "Le Petit Four",
str_detect(tolower(value), "lucky coin") ~ "Lucky Coin",
str_detect(tolower(value), "m&s") ~ "M&S",
str_detect(tolower(value), "marks") ~ "M&S",
Expand Down Expand Up @@ -453,17 +484,13 @@ data_process_ops_simple_ireland <- data_services_info %>%
data_operators <- data_process_ops_simple_all %>%
left_join(data_process_ops_simple_ireland) %>%
left_join(data_process_ops_single) %>%
left_join(data_process_ops_twins) %>%
left_join(data_process_ops_pair) %>%
mutate(across(everything(), ~replace_na(.x, 0))) %>%
mutate(n_named_sites_mainland = n_named_sites_all - n_named_sites_ireland) %>%
select(
operator,
n_named_sites_all,
n_named_sites_mainland,
n_named_sites_ireland,
everything())
data_operators
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ Ernies
Farm Shop
Fifth Wheel Bar and Grill
FoneBiz
"Food to Go
Farm Cafe"
Food to Go - Farm Cafe
Fresh Express
Fresh Food Cafe
Full House
Expand All @@ -48,7 +47,6 @@ Hot Food Co
KFC
Knickerbox
Krispy Kreme
LP4
Ladbrokes
Le Petit Four
Leaf Gifts
Expand Down Expand Up @@ -90,8 +88,6 @@ WHSmiths
Waitrose
Welcome Break Gaming
West Cornwall Pasty Company
Westmorland restaurant and bar
Westmorland shop
Wetherspoon's
Wild Bean Cafe
Wimpy
Expand Down
Binary file modified posts/2024-11-13_motorway-service-stations-info/retailer_types.xlsx
Binary file not shown.

0 comments on commit 43c8efe

Please sign in to comment.