-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
_13-ex.Rmd
72 lines (57 loc) · 3.2 KB
/
_13-ex.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
```{r 13-ex-e0, message=FALSE}
library(sf)
library(spDataLarge)
```
E1. In much of the analysis presented in the chapter we focused on active modes, but what about driving trips?
- What proportion of trips in the `desire_lines` object are made by driving?
- What proportion of `desire_lines` have a straight line length of 5 km or more in distance?
- What proportion of trips in desire lines that are longer than 5 km in length are made by driving?
- Plot the desire lines that are both less than 5 km in length and along which more than 50% of trips are made by car.
- What do you notice about the location of these car dependent yet short desire lines?
```{r 13-e1, eval=FALSE, echo=FALSE}
sum(desire_lines$car_driver) / sum(desire_lines$all)
# 57%
desire_lines_5km_plus = desire_lines |>
filter(distance_km > 5)
# Just over are half ar 5km+, 54%:
nrow(desire_lines_5km_plus) / nrow(desire_lines)
# 71 of 5km+ trips are made by car
sum(desire_lines_5km_plus$car_driver) / sum(desire_lines_5km_plus$all)
desire_lines_driving = desire_lines |>
mutate(`Proportion driving` = car_driver / all) |>
filter(`Proportion driving` > 0.5)
nrow(desire_lines_5km_plus_driving) / nrow(desire_lines)
desire_lines_5km_less_50_pct_driving = desire_lines |>
filter(distance_km <= 5) |>
mutate(`Proportion driving` = car_driver / all) |>
filter(`Proportion driving` > 0.5)
desire_lines_5km_less_50_pct_driving |>
tm_shape() +
tm_lines("Proportion driving")
```
E2. What additional length of cycleways would result if all the routes presented in the last Figure, on sections beyond 100 m from existing cycleways, were constructed?
```{r 13-transport-29, eval=FALSE, echo=FALSE}
sum(st_length(route_network_no_infra))
# 104193.6 [m]
# Just over 100 km
```
E3. What proportion of trips represented in the `desire_lines` are accounted for in the `routes_short_scenario` object?
- Bonus: what proportion of all trips happen on desire lines that cross `routes_short_scenario`?
```{r 13-transport-30, echo=FALSE, eval=FALSE}
sum(routes_short_scenario$all) / sum(desire_lines$all) # 13%
d_intersect = desire_lines[routes_short_scenario, , op = st_crosses]
sum(d_intersect$all) / sum(desire_lines$all) # 88%
```
E4. The analysis presented in this chapter is designed for teaching how geocomputation methods can be applied to transport research.
If you were doing this for real, in government or for a transport consultancy, what top 3 things would you do differently?
```{r}
# Higher level of geographic resolution.
# Use cycle-specific routing services.
# Identify key walking routes.
# Include a higher proportion of trips in the analysis
```
E5. Clearly, the routes identified in the last Figure only provide part of the picture.
How would you extend the analysis?
E6. Imagine that you want to extend the scenario by creating key *areas* (not routes) for investment in place-based cycling policies such as car-free zones, cycle parking points and reduced car parking strategy.
How could raster\index{raster} datasets assist with this work?
- Bonus: develop a raster layer that divides the Bristol region into 100 cells (10 by 10) and estimate the average speed limit of roads in each, from the `bristol_ways` dataset (see Chapter \@ref(location)).