forked from nate-parrott/subway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
howitworks.html
67 lines (67 loc) · 2.26 KB
/
howitworks.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>BART Transit Time Map: how does it work?</title>
<style>
body {
background-color: #363638;
color: white;
line-height: 1.4;
font-family: "HelveticaNeue", "Helvetica", "Arial", sans-serif;
-webkit-font-smoothing: antialiased;
}
article {
padding: 0 20px;
margin: auto;
max-width: 700px;
margin-top: 4em;
}
a:link,
a:visited {
color: inherit;
}
</style>
</head>
<body>
<article>
<h1>BART Transit Time Map: how does it work?</h1>
<section>
<p>
All the data that went into the map comes from
<a href="https://www.bart.gov/schedules/developers/gtfs"
>BART's GTFS feed</a
>, which provides information about routes, stops and schedules.
</p>
<p>
The map is rendered using <a href="https://d3js.org">D3</a> —
initially, acccording to the latitude and longitude of each stop. But
when you click a stop, a simulation is run to calculate the travel
time from that stop to every other stop. Using train departure times
from the BART, and BART's predicted <em>transfer times</em> within
stations, the code counts how many minutes it takes for a simulated
passenger departing the selected stop at 8:00 on a weekday would
arrive at each stop on the map. [You can see the code for this on
Github — the simulation is done in
<a href="https://github.com/eiiot/subway/blob/master/virtual_rider.js"
>virtual_rider.js</a
>].
</p>
<p>
Once travel times are computed, positioning each stop is done by
measuring the geographic angle from the selected stop to each other
stop, but adjusting the <em>distance</em> from the selected stop so
that it's proportional to travel time.
</p>
<p>
For more technical details, see the
<a
href="https://github.com/nate-parrott/subway/tree/master#nyc-travel-time-map"
>Readme</a
>
on GitHub.
</p>
</section>
</article>
</body>
</html>