-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.Rmd
More file actions
361 lines (245 loc) · 7.83 KB
/
index.Rmd
File metadata and controls
361 lines (245 loc) · 7.83 KB
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
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
---
title: "Zonebuilders"
subtitle: "Cross-platform and language-agnostic tools for generating zoning systems for urban analysis and modelling "
author: "Robin Lovelace, Martijn Tennekes, Dustin Carlino, FOSS4G 2021"
output:
xaringan::moon_reader:
css: xaringan-themer.css
nature:
slideNumberFormat: "%current%"
highlightStyle: github
highlightLines: true
ratio: 16:9
countIncrementalSlides: true
---
```{r, eval=FALSE, echo=FALSE}
# to run these slides locally:
xaringan::inf_mr("index.Rmd")
```
```{r xaringanExtra, echo=FALSE}
# From https://github.com/gadenbuie/xaringanExtra
xaringanExtra::use_xaringan_extra(c("tile_view", "animate_css", "tachyons"))
```
```{r setup, include=FALSE}
options(htmltools.dir.version = FALSE)
knitr::opts_chunk$set(
fig.width=9, fig.height=3.5, fig.retina=3,
out.width = "100%",
# cache = TRUE,
echo = FALSE,
message = FALSE,
warning = FALSE,
fig.show = TRUE,
hiline = TRUE
)
```
```{r xaringan-themer, include=FALSE, warning=FALSE}
library(xaringanthemer)
style_duo_accent(
link_color = "blue",
title_slide_background_color = "#FFFFFF",
title_slide_background_size = "100%",
title_slide_background_image = "zb_buenos_aires.png",
title_slide_background_position = "bottom",
title_slide_text_color = "#080808",
primary_color = "#080808",
secondary_color = "#FF961C",
inverse_header_color = "#FFFFFF"
)
```
## About us
.left-column[
```{r, echo=TRUE}
# Reproducible
# R code
# Install pkgs...
library(tmap)
library(tidyverse)
tmap_mode("view")
people = c("Robin", "Martijn", "Dustin")
location = c("Leeds, UK", "Maastricht, Holland", "Seattle, USA")
year = c(2019, 2019, 2020)
people_locations = tmaptools::geocode_OSM(location, as.sf = TRUE)
people_data_frame = data.frame(people, location, year)
people_sf = sf::st_sf(people_data_frame, geometry = people_locations$point)
zones = purrr::map_dfr(location, zonebuilder::zb_zone)
m = tm_shape(zones) +
tm_borders() +
tm_text("label", col = "grey") +
tm_shape(people_sf) +
tm_text("people", scale = 2)
```
]
.right-column[
```{r, out.height=500}
m
```
]
---
.left-column[
# Why?
- Every city has a different zoning system
- Need for consistency when doing inter-city comparisons
- Need for a general solution
- Existing 'zone-building' systems start with 'basic statistical units' (BSUs)
- Fun FOSS programming challenge!
]
--
.right-column[
## Available zones are often arbitrary
```{r, fig.height=6}
u = "https://geodata.lib.berkeley.edu/download/file/nyu-2451-34202-geojson.json"
f = "buenos_aires_official_zones.geojson"
# download.file(u, f)
zones_ba = sf::read_sf(f)
tm_shape(zones_ba) +
tm_borders(lwd = 9) +
tm_basemap(server = leaflet::providers$OpenStreetMap) +
tm_scale_bar()
```
]
???
- Contents: ...
<!-- --- -->
<!-- # Early prototypes -->
---
#### Application: communicating and navigating city locations

???
Illustration of how the ClockBoard system could be used to describe the approximate location of places. In this hypothetical example, someone is describing key places to visit in and around Leeds to someone who arrives at the train station in zone A, visits the city’s famous Roundhay Park in zone C01, before travelling for an evening meal in Bradford, in zone E09.
---
## Application: exploring city scale data

---
background-image: url(https://github.com/zonebuilders/zonebuilder/releases/download/v0.0.2.9000/cities_p1.png)
background-position: center
background-size: contain
--
#### Inter-city
#### comparisons
#### population
---
background-image: url(https://zonebuilders.github.io/zonebuilder/articles/paper_files/figure-html/intercity-1.png)
background-size: contain
#### Application: inter-city comparisons: urban phenomena
---
# Using the ZoneBuilder software
.pull-left[
```{r, echo=TRUE}
library(zonebuilder)
z = zb_zone(
"Buenos Aires",
n_circles = 9
)
```
```{r, eval=FALSE, echo=TRUE, out.height=9}
library(tmap)
tmap_mode("view")
tm_shape(z) +
tm_borders() +
tm_basemap(leaflet::providers$OpenStreetMap) +
tm_scale_bar()
```
]
.pull-right[
```{r, echo=FALSE}
library(tmap)
tmap_mode("view")
tm_shape(z) +
tm_borders() +
tm_basemap(leaflet::providers$OpenStreetMap) +
tm_scale_bar()
```
]
---
## With the R package
You can install the released version of zonebuilder from [CRAN](https://CRAN.R-project.org) with:
```{r, eval=FALSE, echo=TRUE}
install.packages("zonebuilder")
```
Install it from [GitHub](https://github.com/) with:
```{r install-gh, eval=FALSE, echo=TRUE}
# install.packages("remotes")
remotes::install_github("zonebuilders/zonebuilder")
```
```{r, echo=TRUE}
library(zonebuilder)
library(tmap)
tm_shape(london_a()) + tm_borders() + tm_shape(london_c()) + tm_dots("red")
```
---
## Create zones in one command
```{r, echo=TRUE}
london_zones <- zb_zone(london_c(), london_a())
zb_plot(london_zones)
```
---
# Output the results
```{r, echo=TRUE, eval=FALSE}
sf::write_sf(london_zones, "london_zones.geojson")
```
---
## With the Rust crate
### See https://github.com/zonebuilders/zonebuilder-rust
Install Rust + cargo
```bash
cargo install zonebuilder
```
See the help with:
```{r, engine='bash', echo=TRUE}
zonebuilder -h
```
---
## Minimal Rust example
.pull-left[
```{r, engine='bash', echo=TRUE}
zonebuilder -s 3 -d 1.0,3.0 > zones.geojson
cat zones.geojson
```
]
.pull-right[

]
---
## With the Python package or QGIS plugin

--
See https://github.com/zonebuilders/zonebuilder/issues/41
???
Let us know if you'd like to get involved!
---
## In your web browser 🤯
Try the Wasm based tool at: https://zonebuilders.github.io/zonebuilder-rust/

---
# The ClockBoard paper
- Preprint paper on the ClockBoard zoning system. See https://doi.org/10.31219/osf.io/vncgw for details

---
# Next steps
.pull-left[
## Conceptually
- How much can the ClockBoard concept catch on?
- What alternative zoning systems can be imagined/created?
- How to design a zoning system incorporating multiple city centres?
]
.pull-right[
## Technologically
- Fix any outstanding bugs in R and Rust implementations
- Add features to R and Rust implemenations
- Zonebuilder implementations in other languages
- Python, JavaScript, Julia, Go? Great geo learning exercise.
- Interfaces to the Rust implementation, e.g. via [rextendr](https://github.com/extendr/rextendr) R package and the [pyo3](https://github.com/PyO3/pyo3) Python package
- Create standard zones ready to be used for major cities worldwide
]
---
# Thanks
- Stephan Hügel and the GeoRust community for support with the Rust code
- The broadly defined R-Spatial community for making the R package possible
- The OSGEO community and developers for making solid open source software possible
## Links
- [Paper](https://zonebuilders.github.io/zonebuilder/articles/paper.html) describing the ClockBoard zoning system, implemented with zonebuilders
- [zonebuilder R package](https://zonebuilders.github.io/zonebuilder) for building zones in R
- [zonebuilder Rust crate](https://crates.io/crates/zonebuilder) for building zones in Rust/anywhere
- [zonebuilder web app](https://zonebuilders.github.io/zonebuilder-rust) for building zones in your browser
- [Reproducible source code](https://github.com/zonebuilders/zonebuilders.github.io/blob/master/index.Rmd) of these slides (and the software) on GitHub