forked from mpadge/gender-conscious-routing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
182 lines (154 loc) · 7.82 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
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
out.width = "100%"
)
```
<!-- badges: start -->
[![R build status](https://github.com/mpadge/gender-conscious-routing/workflows/R-CMD-check/badge.svg)](https://github.com/mpadge/gender-conscious-routing/actions?query=workflow%3AR-CMD-check)
[![codecov](https://codecov.io/gh/mpadge/gender-conscious-routing/branch/master/graph/badge.svg)](https://codecov.io/gh/mpadge/gender-conscious-routing)
[![Project Status: Concept](http://www.repostatus.org/badges/latest/concept.svg)](http://www.repostatus.org/#concept)
<!-- badges: end -->
# gender conscious routing
Routing along streets named after women rather than men.
## A note on gender
Where possible, gender is identified through wikidata entries, which
accommodate values of female, male, intersex, transgender female, and
transgender male. Street names which are not associated in Open Street Map with
wikidata entries are assigned genders using an internally-bundled library which
presumes that gender is binary. Which it is not. This package and its
developers neither endorse nor encourage viewing gender in binary terms. The
library nevertheless allows gender associations in a very wide variety of
languages, far more than any other equivalent library, and so allows the
functionality of this package to be applied to far greater regions of the world
that would other, non-binary alternatives. See the vignette for further detail
on the gender encoding system used here.
---
## Generating gender-conscious routes
The function `conscious_route()` calculates routes which preferentially
traverse streets named after women. Usage requires downloading a street
network, the simplest way of which is to use [the `dodgr`
package](https://github.com/atfutures/dodgr). It is good practice to save
networks locally, to avoid having to repeat calls to the Open Street Map
servers which deliver the data.
```{r, dodgr_streetnet_sc, eval = FALSE}
city <- "Aachen Germany"
net <- dodgr::dodgr_streetnet_sc (city)
saveRDS (net, "mynetwork.Rds")
```
The gender of all streets can then be appended to the network data with the
`gender_streetnet()` function, which also accepts an additional parameter,
`wt_profile`, used to specify the weighting profile from [the profiles of the
`dodgr`
package](https://atfutures.github.io/dodgr/reference/weighting_profiles.html).
```{r gender_streetnet, eval = FALSE}
library (genderconsciousrouting)
net <- gender_streetnet (dat, wt_profile = "foot")
```
Gender-conscious routes can then be generated by specifying start and end
points. The following example selects random points from the network vertices.
```{r verts, eval = FALSE}
v <- dodgr::dodgr_vertices (net)
set.seed (1)
start <- sample (v$id, size = 1L)
stop <- sample (v$id, size = 1L)
```
Those `id` values are the Open Street Map identifiers of two random vertices
(or "nodes" in Open Street Map terms) of the network. Finally, the following
code calculates the path between them which traverses the greatest
proportional length along streets named after women:
```{r route-demo, echo = FALSE, eval = FALSE}
set.seed (6)
start <- sample (v$id, size = 1L)
stop <- sample (v$id, size = 1L)
conscious_route (net, start = start, stop = stop)
```
```{r route, eval = FALSE}
conscious_route (net, start = start, stop = stop)
#> $p_stats
#> d_female d_male d_non p_female p_male p_non path_length path_length_rel
#> default 0.000 190.454 8277.046 0.0000000 0.02249235 0.9775076 8467.50 1.000000
#> female 1826.583 335.371 8083.941 0.1782746 0.03273223 0.7889932 10245.89 1.210026
#>
#> $paths
#> type geometry
#> 1 default LINESTRING (6.166698 50.812...
#> 2 female LINESTRING (6.166698 50.812...
#n>
#> $points
#> x y colour
#> 25722 6.166698 50.81288 #44FF22FF
#> 137140 6.020574 50.75566 #FF4422FF
```
The function returns a list of the following three items:
1. `p_stats` providing statistics on absolute and relative distances along the
types of ways (where "non" suffixes denote ways not named after people).
2. `paths` providing the path geometries, both of the gender-conscious route,
and the "default" route which does not follow gender conscious paths; and
3. `points` with locations of the specified start and end points, along with
colour codes which can be used to clearly indicate those points on
interactive maps.
---
## Aggregate statistics for a whole city
Aggregate analyses of statistics on the gender of street names can be seen in
[the EqualStreetNames project](https://equalstreetnames.org/), which currently
provides interactive visualisations for 45 cities around the world. The results
are, however, static, and only quantify overall proportions regardless of where
streets are located. Many cities consciously name central avenues or boulevards
after men, while streets named after women may be placed in peripheral
locations rarely traversed by the general population. A more appropriate way to
quantify statistics on relative gender proportions is to weight gendered
streets by their importance within the spatially-explicit context of the entire
street network. The most direct way to do that is to weight each
gender-specific street segment by its corresponding network centrality, so that
central segments traversed by large numbers of people contribute more than
peripheral segments. The `genderconsciousrouting` package has an additional
function which performs these analyses for a given city.
The function works by tracing routes between randomly sampled points in a
network, with a default to calculate all possible paths between all pairs of
vertices in the street network. This function takes considerably more time to
calculate than the simple route function demonstrated above, and it is
recommended to first specify a value for the number of sampled points of around
1,000. The time taken can then be scaled by the default total number of points,
which is equal to `nrow(dodgr_vertices(net))`, to estimate how long a full
calculation might take.
```{r gcr_city, eval = FALSE}
dat <- gcr_city (net, n = 1000)
▶ Contracting street network ...
✔ Contracted street network
▶ Calculating routes (1/2) ...
▶ Calculated routes (1/2)
✔ Calculating routes (2/2) ...
▶ Calculated routes (2/2)
print (dat)
#> wt_profile category proportion
#> 1 foot IS_FEMALE 0.002963653
#> 2 foot IS_MALE 0.021652605
#> 3 foot NOT_A_NAME 0.975383742
#> 4 foot IS_A_NAME 0.024616258
#> 5 foot IS_FEMALE_RAW 0.006148932
#> 6 foot IS_MALE_RAW 0.025953586
#> 7 foot NOT_A_NAME_RAW 0.967897482
#> 8 foot IS_A_NAME_RAW 0.032102518
#> 9 foot pedestrian 0.447916183
#> 10 foot vehicular_foot 0.500669268
#> 11 foot pedestrian_RAW 0.255423713
#> 12 foot vehicular_foot_RAW 0.697429330
```
The first 8 statistics (with capitalised values for `category`) are
divided between "raw" and weighted statistics, where the former are simple
aggregate proportions of the type presented in
[EqualStreetNames](https://equalstreetnames.org/), while those without the
`_raw` suffix are weighted by network centrality, such that more central
streets contribute more. The final four statistics quantify the proportions of
journeys along dedicated infrastructure, and are primarily intended to quantify
the relative prominence of dedicated pedestrian (`wt_profile = "foot"`) and bicycle
(`wt_profile = "bicycle"`) infrastructure in cities. The `vehicular_foot` rows
quantify the proportions of journeys or overall edge lengths (`_RAW`) for which
pedestrian or bicycle infrastructure travels directly beside vehicular ways,
rather than on dedicated infrastructure.