-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
328 lines (243 loc) · 14.6 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
---
output: github_document
# output:
# bookdown::word_document2:
# number_sections: true
title: "Visualising transport energy use: from area to route network levels"
# bibliography: od.bib
bibliography: allrefs.bib
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r setup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
eval = FALSE,
echo = FALSE
)
```
```{r, eval=FALSE, echo=FALSE, message=FALSE, warning=FALSE}
citr::tidy_bib_file(rmd_file = "README.Rmd", messy_bibliography = "~/uaf/allrefs.bib", file = "od.bib")
file.copy("README.docx", "~/Pictures/visualising-transport-energy-use.docx", T)
```
<!-- # Notes -->
<!-- *This paper is work in progress. Comments and suggested changes are welcome.* -->
<!-- See the .Rmd file that contains the source code to reproduce the results (code not shown by default) -->
```{r setuppkgs, message=FALSE}
# Note: these packages must be installed to reproduce the results
library(pct)
library(sf)
library(stplanr)
library(tidyverse)
library(tmap)
```
<!-- ## Papers to cite -->
<!-- We should probably cite these papers (please add more): -->
<!-- - Paper on OD data for geodemographics: http://www.sciencedirect.com/science/article/pii/S0198971516303301 -->
<!-- [@martin_origin-destination_2018] -->
<!-- - [@alexander_validation_2015; @he_simple_2018; @munuzuri_estimation_2004] -->
# Introduction
<!--
Draft suggestion for a new first paragraph (see comments below)
-->
Passenger transport was --- before the physical distancing measures and movement restrictions introduced in response to the Covid-19 Pandemic [e.g. @wilder-smith_isolation_2020; @mitja_experts_2020; @jarvis_quantifying_2020] --- a major, rapidly growing and particularly difficult-to-mitigate source of energy use and emissions [@gul_energy-economic_2009; @moriarty_global_2016; @gota_decarbonising_2019].
Notwithstanding the potential for societal transformation it is possible, if not likely, that passenger transport energy use will continue its upward trajectory when restrictions on movement are relaxed.
However, passenger transport is rarely accounted-for in aggregate statistics or thinking about energy use at national, let alone sub-national levels.
Too often energy policies completely ignore transport.
This paper aims to address these issues head-on, by demonstrating the potential for geographic visualisation methods to 'bring to life' the energy (and resulting emissions) impacts of transport, to inform thinking around and interventions enabling the rapid decarbonisation of the sector.
The use of progressively more detailed visualisation techniques, from time series of sectoral energy use trajectories (including uncertainty of the future) to 'route network' energy use plots that can show energy use down to the road segment level to flag the role of carbon-intensive infrastructure is illustrated in the results, building on a national origin-destination dataset based on the UK's 2011 Census.
Globally, land-based passenger transport accounted for around 3.6 Gt CO2 in 2018, 11% of the global total.
Passenger land transport is the single largest sub-sector within the transport sector with passenger, road freight, aviation, shipping and other modes accounting for 45%, 30%, 11%, 11% and 3%, of the sector's emissions respectively, omitting the increased impact of high altitude emissions from flying, accounting for 45% of transport emissions [@sims_transport_2014].^[
See the International Energy Agency's interactive transport energy emissions tracker at https://www.iea.org/reports/tracking-transport-2019 for details.
]
The focus of the paper is on the UK, where the gap between projections of future emissions and the necessary cuts, to reach zero carbon by 2050, is larger than for other sectors [@departmentfortransport_decarbonising_2020].
The UK is not necessarily representative of the global situation, but represents a good case study country due to the provision of national open access origin-destination data at high levels of geographic resolution [@lovelace_propensity_2017].
The challenges that the UK's passenger transport sector faces from an emissions perspective, including high level of car dependency and under-investment in and capacity limits on public transport [@anable_complacent_2005; @pisu_improving_2015b], are not unique to Northern Europe.
```{r, eval=FALSE}
scholarsearch::scholarsearch("uk public transport investment capacity", as_ylo = 2010)
```
<!-- [@zhang_role_2020] -->
```{r, eval=FALSE}
# passenger shares in global emissions
8.0 / 0.24 # 33 Gt
3.6 / 33
2.4 / 33
0.9 / 33
0.9 / 33
0.3 / 33
3.6 / 8
2.4 / 8
0.9 / 8
0.9 / 8
0.2 / 8
sum()
```
<!-- We analyse and visualise passenger transport data from the UK in order to understand which modes of transport are being used across the country. The aim of the study is to enable policy makers to invest in infrastructure which enables low-energy modes of transport, such as public transport and cycling. -->
# Visualising transport energy use
<!-- This is the literature review -->
Energy use is an inherently ephemeral phenomenon.
Although, as the second law of thermodynamics states, energy cannot be created or destroyed, *useful energy* in the fossil fuel age exists only during the relatively short span between non-renewable sources being extracted and burned.
In the coming renewable energy age, useful energy will exist for even less time, between conversion of environmental energy fluxes into electricity, transmission, and comparatively costly temporary storage.
The second law of thermodynamics tells us that what we call energy use is in fact energy conversion, and every conversion results in less useful energy, in continuous and ubiquitous energy converters with varying power levels and load profiles.
In the context of passenger transport, the prime example of these conversions is in the privately owned car, often the most powerful energy converter people have access to.
<!--
* I suggest to move this paragraph a bit further. In my opinion, the first paragraph should be a to-the-point summary of our paper. This paragraph is about the physics of energy, which is more background. I added a new first paragraph as suggestion.
* Also, it was quite difficult for me to read, and probably also for other non-native-English/non-specialist-in-energy people. Specifically:
* A few difficult words which I had to look up: ephemeral and ubiquitous. Could be due to my bad English.
* This paragraph is basically a summary of physics about energy. For non-specialists like me, it took me some time to digest, and also raises some questions, such as
* What happens with the non-useful energy?
* How does energy conversion work?
* What exactly is renewable and non-renewable energy?
* 'the privately owned car': I assume that rental cars are just as bad.
-->
The act of travel involves moving across geographic space.
Policies to reduce excessive transport energy use can be divided into three categories from a geographic perspective:
- trip origins, typically residential locations where journeys begin
- trip destinations, typically 'trip generators' such as school, hospitals and work places where trips end
- and places in between, typically transport infrastructure
Most research into transport energy use has focussed on the first of these categories.
This makes sense from a citizen-focussed policy perspective, enabling residential areas with excessive transport energy use to be identified.
From geographic and energy systems perspectives, it makes sense to identify opportunities to intervene across the range of places and points in transport-energy systems.
Examples of interventions focussing on each of the geographic 'locations' outlined above include: localised parking restrictions discouraging high car ownership in specific areas (at trip origins); increased parking costs at major trip attractors such as city centre car parks and airports (at destinations); and road pricing to subsidise public transport modes (between origins and destinations).
The spatially distributed nature of transport energy use makes it not only possible, but also useful to analyse it across geographic space.
We analyse geographic transport behaviour by using aggregated origin-destination data (OD data), which contains the numbers of people travelling from origin to destination via intermediate points, by mode of transport.
This paper sets out a case for analysing and visualising transport analysis at this OD level.
- Something on different levels of energy analysis.
- Something on visualisation of spatial phenomena, e.g. building on [@rae_spatial_2009]
# Data and methods
...
# Levels of visualisation
## Time series plots
## Origin-destination data
OD datasets are 'implicitly geographic': their coordinates are not contained in the data, but associated with another data object, typically a zone or a zone centroid.
An example demonstrating OD data is shown below, which represents 2.4 million desire lines at the MSOA-MSOA level in England and Wales.
The dataset shows the overall travel to work patterns across the UK, based on 21.6 million people in which both origin and destination were reported in the 2011 Census.
This represents 81% of all commuters in the open access origin-destination data contained in the file `wu03ew_v2.csv`, which can be downloaded from http://wicid.ukdataservice.ac.uk/ as follows:
```{r}
od_data_all = pct::get_od()
# remove intra-zonal
cents_ew = pct::get_centroids_ew()
od_data_inter = od_data_all[
od_data_all$geo_code1 %in% cents_ew$msoa11cd &
od_data_all$geo_code2 %in% cents_ew$msoa11cd ,
]
# subset lines to speed-up od2line function
# od_cars = od_data_all[od_data_all$car_driver >= 5, ] # 440000 lines
od_cars = od_data_inter[od_data_inter$all >= 10, ] # 360695 lines
sum(od_cars$all) / sum(od_data_inter$all) # represents 80% of all inter-zonal flow
lines_cars = od2line(od_cars, cents_ew)
plot(lines_cars[1:999, ])
lines_cars$euclidean_distance_m = as.numeric(sf::st_length(lines_cars)) / 1000
lines_cars$car_km = lines_cars$car_driver * lines_cars$euclidean_distance_m
summary(lines_cars$car_driver)
```
by the number of car km used for travel to work, which can be downloaded, read-in and plotted as follows:
```{r, out.width="100%", warning=FALSE}
download.file(url = "https://github.com/ropensci/stplanr/releases/download/0.2.9/desire_lines_cars.Rds", "desire_lines_cars.Rds")
lines_cars = readRDS("desire_lines_cars.Rds")
lines_cars$`Drive to work (%)` = lines_cars$car_driver / lines_cars$all * 100
# plot(lines_cars["car_km"], lwd = lines_cars$car_km / 1000)
sum(lines_cars$all)
lines_cars$energy_cars = lines_cars$car_km *
2.5 * # average energy use per vehicle km
220 * # estimated number of commutes/yr
2.6 # circuity (estimated at 1.3) multiplied by 2
lines_cars_top = lines_cars %>%
top_n(n = 100000, wt = energy_cars)
# top_n(n = 200000, wt = energy_cars)
```
```{r}
m = tm_shape(lines_cars_top) +
tm_lines(palette = "-viridis", breaks = c(0, 50, 60, 70, 80, 90, 100),
lwd = "all",
lwd.legend = c(200, 400, 600),
scale = 15,
title.lwd = "Number of trips",
alpha = 0.8,
col = "Drive to work (%)"
) +
tm_scale_bar()
tmap_save(m, "overview_map1.png")
```
```{r, eval=TRUE, echo=FALSE}
knitr::include_graphics("overview_map1.png")
```
Based on the estimate of the average energy use per km being 2.5 MJ, and that these return trips are made on average 200 times per year, with a circuity (the ratio of straight line distance to route distance) of 1.3, we can estimate the total energy use of the 'high energy commutes' as follows:
```{r}
pj_to_mtoe = 41.86
56.5 * pj_to_mtoe
sum(lines_cars$energy_cars / 1e9) / (56.5 * pj_to_mtoe) * 100 # 12% of transport energy use
sum(lines_cars_top$energy_cars / 1e9) / (56.5 * pj_to_mtoe) * 100 # 1.4% of transport energy use
```
That represents ~10 petajoules (PJ), only for the top 20,000 most energy intensive commutes.
That may seem like a lot, but represents only a fraction of the UK's total energy use of [~200 Mtoe](https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/729451/DUKES_PN.pdf) (8400 PJ).
## Zone of origin
The energy use presented at the OD level in the previous section can be aggregated to the zone level.
## Zone of destination
## Centroids
An issue with visualising zonal data on geographic maps is that the results can over-emphasise attributes large, rural areas [@ref].
```{r}
zones_attr = lines_cars %>%
st_drop_geometry() %>%
group_by(geo_code1) %>%
summarize_if(is.numeric, sum) %>%
dplyr::rename(msoa11cd = geo_code1)
zones_joined = left_join(cents_ew, zones_attr)
zones_od = lines_cars %>%
st_drop_geometry() %>%
select(msoa11cd = geo_code2, energy_cars_dest = energy_cars) %>%
group_by(msoa11cd) %>%
summarize_if(is.numeric, sum) %>%
inner_join(zones_joined, .)
plot(zones_od[c("energy_cars", "energy_cars_dest")])
m = tm_shape(zones_od) +
tm_dots(c("energy_cars", "energy_cars_dest"), size = c("energy_cars", "energy_cars_dest"), pal = "Accent", alpha = 0.9,
legend.size.show = FALSE,
# midpoint = 200e6,
# style = "quantile",
breaks = c(0, 1, 10, 100, 1000) * 1e6
) +
tm_facets(free.scales = FALSE)
tmap_save(m, "energy_origins_destinations.png")
```
```{r, echo=FALSE, eval=TRUE}
knitr::include_graphics("energy_origins_destinations.png")
```
## Visualising desires lines
## Desire lines
## Desire lines with direction
## Routes
## Route networks
# Discussion and conclusion
A next step for this will be to compare 'high energy origins' and 'high energy destinations' with other energy-related variables.
We will also look at the impact of using route distances rather than straight line distances with an average circuity.
```{r, echo=FALSE, eval=FALSE}
# route data from Malcolm
piggyback::pb_list()
piggyback::pb_download("top10000routes.Rds")
piggyback::pb_download("top10000routes_missing.Rds")
r = readRDS("top10000routes.Rds")
r_missing = readRDS("top10000routes_missing.Rds")
r = rbind(r, r_missing)
# saveRDS(r, "routes-all-100000.Rds")
# piggyback::pb_upload("routes-all-100000.Rds")
names(r)
r_top = r %>%
filter(fromPlace %in% lines_cars_top$geo_code1) %>%
filter(toPlace %in% lines_cars_top$geo_code2)
plot(r_top[1:999, "mode"])
names(lines_cars_top)
# # fails as from/to reversed:
# r_joined = r_top %>%
# rename(geo_code1 = toPlace, geo_code2 = fromPlace) %>%
# inner_join(., sf::st_drop_geometry(lines_cars_top))
r_joined2 = r_top %>%
rename(geo_code2 = toPlace, geo_code1 = fromPlace) %>%
inner_join(., sf::st_drop_geometry(lines_cars_top)) %>%
sf::st_zm()
names(r_joined2)
rnet = stplanr::overline2(r_joined2, "car_driver")
```
# References