-
Notifications
You must be signed in to change notification settings - Fork 0
/
RoadClosures_RLadiesHackathon.Rmd
178 lines (122 loc) · 3.64 KB
/
RoadClosures_RLadiesHackathon.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
---
title: "Road Closures"
author: "Peter Tarbit (they/them)"
subtitle: "#qldfloods"
date: "29/06/2022"
output:
ioslides_presentation:
css: assets/torino_style.css
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE)
library(tidyverse)
library(shiny)
qut_blue = "#00407a"
qut_dark_blue = "#06ABE8"
```
<!-- Remove slide numbers -->
<style type="text/css">
slides > slide:not(.nobackground):after {
content: '';
}
</style>
<!-- Code to make images full size -->
<style>
.fullslide img {
margin-top: -85px;
margin-left: -60px;
width: 900px;
height: 700px;
}
</style>
## Team
<center>
<img src="images/Sarah-Vollert.jpg" width = 30%>
<img src="images/Cailan.jpg" width = 30%>
<img src="images/jackson-kwok.jpg" width = 30%>
</center>
<p>
Sarah Vollert
Cailan Jeynes-Smith
Jackson Kwok</p>
## {.fullslide}
<center>
<img src="images/QUT_flooding.jpg">
</center>
<div style="position: absolute; left: 300px; top:450px;background-color:#00407a72";>
<p><font color="white">
<br><strong> Motivation and Gap </strong><br>
</font></p></div>
## Current Data
<iframe width='1000px' height='1000px' src='https://qldtraffic.qld.gov.au/listview.html' >
<p>Your browser does not support iframes</p>
</iframe>
## Current Data
<iframe width='1000px' height='1000px' src='https://qldtraffic.qld.gov.au/index.html' >
<p>Your browser does not support iframes</p>
</iframe>
## {.fullslide}
<center>
<img src="images/flood_map.png">
</center>
<div style="position: absolute; left: 50px; top:150px;background-color:#00407a72";>
<p><font color="white">
<br><strong> Predicted Flood Extent </strong><br>
</font></p></div>
## Initial Solution
Web Scraping the QLD Traffic list page, then using that data to make a better visualization
<br>
Problems:
- Difficult due to the nature of the page
- Still doesn't solve the problem of incomplete reporting
## Shiny Solution
Crowd sourced data can fill this data gap
How do we get this data?
How do we display this data?
<br>
We solved these two questions using the R packeges Shiny and Leaflet
<center>
<img src="images/shinyLogo.png" width = 20%>
<img src="images/leafletLogo.png" width = 50%>
</center>
## Open Street Maps
OpenStreetMap (OSM) is a collaborative project to create a free editable geographic database of the world.
Data is in a .pbf file ("Protocolbuffer Binary Format")
Contains 5 Layers:
- points => Points of interest, shops, stations, restaurants
- lines => Ways, paths, streets, roads, train tracks
- mlines => Routes
- mpolygons => Regions, Boundaries, Suburbs, Bodies of Water
- relations => no-left-turn instructions
## Demo Code
```{r, eval=F, echo=T}
# get filepath for all osm data for brisbane
file <- "data/Brisbane.osm.pbf"
# extract polygons
feature_mpolygons <- oe_read(file, "multipolygons")
suburb <- "South Brisbane"
# get boundary for desired suburb
suburbBoundary <- filter(feature_mpolygons, name == suburb)
# Extract named roads and paths within suburb
# add columns for status and # of reports
subsetRoads <- oe_read(file, "lines", boundary = suburbBoundary) %>%
drop_na(name, highway) %>%
mutate(open = TRUE) %>%
mutate(reports = 0)
```
## App
```{r, echo = FALSE}
knitr::include_app("https://slowmath.shinyapps.io/roadClosures/",
height = "500px")
```
## {.fullslide}
<center>
<img src="images/SB_Flooding.jpg">
</center>
<div style="position: absolute; left: 60px; top:530px;background-color:#00407a72";>
<p><font color="white">
<br><strong> Questions </strong><br>
</font></p></div>
<script src = "assets/beamer.js"></script>