-
Notifications
You must be signed in to change notification settings - Fork 4
/
README.Rmd
150 lines (107 loc) · 4.49 KB
/
README.Rmd
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
# cyclability
<!-- badges: start -->
<!-- badges: end -->
The goal of cyclability is to generate estimates of broadly defined cyclability.
There are at least three definitions of how conducive to cycling different places and segments of roads and travel networks are:
- [Level of Traffic Stress](https://docs.conveyal.com/learn-more/traffic-stress) (LTS)
- [Bikeability](https://www.britishcycling.org.uk/cycletraining/article/ct20110111-cycletraining-What-is-Bikeability-0) levels, which rates infrastructure based on the level of training needed to feel comfortable:
- Level 1 teaches basic bike-handling skills in a controlled traffic-free environment.
- Level 2 teaches trainees to cycle planned routes on minor roads, offering a real cycling experience.
- Level 3 ensures trainees are able to manage a variety of traffic conditions and is delivered on busier roads with advanced features and layouts
- CycleStreets's [Quietness rating](https://www.cyclestreets.net/help/journey/howitworks/#quietness) from 1 (very unpleasant for cycling) to 100 (the quietest)
# Setup
For this practical we'll be using a number of R packages, which can be installed as follows:
```{r installation, eval=FALSE}
# core packages:
install.packages("remotes")
core_packages = c(
"tidyverse",
"sf",
"tmap"
)
remotes::install_cran(core_packages)
```
Other packages that we use which you may want to install include:
```{r}
other_packages = c(
"r5r"
)
remotes::install_cran(other_packages)
remotes::install_github("cyclestreets/cyclestreets-r")
```
For the practical we assume you have the following packages loaded:
```{r library, message=FALSE}
library(tidyverse)
library(sf)
```
To get going with the data a good starting point is to download the the data in this repo.
Do this by clicking on https://github.com/ITSLeeds/cyclability/archive/refs/heads/main.zip and then download and unzip the folder.
Assuming you have unzipped the folder in your Downloads folder you should be able to open the project with the following command in RStudio:
```{r, eval=FALSE}
rstudioapi::openProject("~/Downloads/cyclability-main/")
```
After you have opened the project you should be able to run the following commands.
Try reproducing the next code chunk to generate a plot to see if it works.
If not you can open an issue at https://github.com/ITSLeeds/cyclability/issues
# Hack agenda and topics
- 15 minutes: get up-to-speed with best practices on data science projects including using software for reproducible and collaborative research such as Git and RStudio.
- 15 minutes Download and reproduce a reproducible script that estimates active travel friendliness based on open access OSM data.
Hack topics:
- Compare CycleStreets vs R5 estimates of cyclability
- Testing and developing methods for geographic joins between route network datasets
- Identifying issues with quietness estimates based on real data data (no code option)
- Think of a route you know well and calculate a route along it with CycleStreets: https://www.cyclestreets.net/
- Issues with the route quietness estimation based on real world knowledge
- ITS Leeds website improvements: https://www.cyclestreets.net/
- Any others
Work to improve the script
# Cyclability data
## LTS data from R5
To get estimates of LTS on the network we used the R5 routing engine via the `r5r` package.
See [code/r5r_setup.R](code/r5r_setup.R) for details.
The resulting estimates of LTS in Leeds can be read-in and visualised as follows:
```{r}
leeds_lts = readRDS("r5r/r5r_lts_osmtags.Rds")
leeds_lts
leeds_lts |>
select(bicycle_lts) |>
plot()
```
```{r, eval=FALSE}
leeds_lts |>
select(bicycle_lts) |>
mapview::mapview(zcol = "bicycle_lts")
```
## Quitness data from CycleStreets
To get estimates of quietness on the network we used `cyclestreets` package.
See [code/cyclestreets_setup.R](code/r5r_setup.R) for details.
The resulting estimates of LTS in Leeds can be read-in and visualised as follows:
```{r}
leeds_quietness = sf::read_sf("cyclestreets/leeds_quietness.geojson")
leeds_quietness
leeds_quietness |>
select(quietness) |>
plot()
```
```{r, eval=FALSE}
leeds_quietness |>
select(quietness) |>
mapview::mapview(zcol = "quietness")
```
## Comparison of cyclability metrics
```{r}
# task for the hackathon
```
# OSM data
# Estimating cyclability with OSM
The purpose of the hackathon!