471 |
472 |
473 |
474 |
475 |
1556 |
1557 |
1560 |
1561 |
1562 |
1563 |
1564 |
1605 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | fts_commute_visualizer
2 | ===
3 |
4 | Build visualizations to see how far you can commute based on transportation mode and real world traffic.
5 |
6 | ## Blog Post
7 |
8 | For additional information read my extensive [blog post](https://blog.forrestthewoods.com/visualizing-commute-times-378009330ffa).
9 |
10 | ## Features
11 |
12 | * Visualize commute times and range both from home or to a destination
13 | * See commute times for walking, bicycling, public transit, or driving.
14 | * See commute time **with traffic* (driving only)
15 | * Specify driving traffic conditions: Best Guess, Optimistic, Pessimistic
16 | * Works in any city for which Google Maps has data
17 |
18 |
19 | ## Installation
20 |
21 | [fts_commute_visualizer.html](fts_commute_visualizer.html) is the only file you need. It contains all HTML, CSS, and JS. It can be run locally. There is no build system. You don't need a webserver.
22 |
23 |
24 | ### Google Maps API Key
25 |
26 | You will need your own API key. Creating a new one is free and easy.
27 |
28 | 1. Enable [Google Dev Console](https://console.developers.google.com) with a Google account.
29 | 2. Create a new project.
30 | 3. Enable Google Maps Javascript API
31 | 4. Enable Google Maps Distance Matrix API
32 | 5. Enable Google Maps Time Zone API
33 | 6. Replace "YOUR_API_KEY" with your API key.
34 |
35 | The Google cloud free tier is limited to 2500 requests per day. Each hexagon counts as 1 request. After reaching your daily limit Google Maps API calls are heavily throttled.
36 |
37 | If you give Google your credit card and sign up for a [free trial](https://cloud.google.com/free/?hl=en_US&_ga=1.18292089.1130590081.1487912420) you can get $300 in free credits. Curiously I'm still not being charged for Distance Matrix queries. I am still throttled, but it's significantly faster. I strongly recommend doing this if you're building large maps or many maps.
38 |
39 | ## Using the Tool
40 |
41 | This is, ahem, a bit of a programmer tool. There are several gotchas and silent errors. Here's what the tool looks like.
42 |
43 | 
44 |
45 | ### Drawing
46 |
47 | On the bottom of the map there's a draw button. (It says 'Clear' in the image above). You want to click that then click and drag on the map. This lets you draw an arbitrary outline for the area you wish to search.
48 |
49 | ### Advanced Search
50 |
51 | When performing an advanced search you must search for a time in the future. If you specify a time in the past it will silently fail. I need to add error messaging.
52 |
53 | ### Transit
54 |
55 | When doing a transit search you almost always want to do an advanced search. Otherwise you will search for routes with a time of "now". Which if you're doing this at home at 8pm is probably not very many routes!
56 |
57 | In hindsight I should have made those settings mandatory and always on. It'd prevent a lot of confusion.
58 |
59 | ### Secret Options
60 |
61 | If you open [fts_commute_visualizer.html](fts_commute_visualizer.html) and go to [line 452](https://github.com/forrestthewoods/fts_commute_visualizer/blob/master/fts_commute_visualizer.html#L452) you should see the following line.
62 |
63 | ```
64 |
65 | ```
66 |
67 | Change "display:none" to "display:block". This turns on some secret options. Of particular note is the ability to hide map UI elements. Which is useful for taking screenshots. You can also mess with hexagon color and opacity at run-time if you feel like changing them.
68 |
69 | I wouldn't call these hidden options "officially supported". But they may be of some use.
70 |
71 |
72 | FAQ
73 | ===
74 |
75 | #### What is fts_commute_visualizer?
76 | A tool I built to help visualize how long it takes to commute based on a mode of transport and travel time.
77 |
78 | #### What license?
79 | All source code is embedded with a dual license. Choose either MIT or Unlicense. See [fts_commute_visualizer.html](fts_commute_visualizer.html) for details.
80 |
81 | #### What is FTS?
82 | My initials; Forrest Thomas Smith.
83 |
84 | #### Why a single file?
85 | Why would this be more than one file? It's a simple project. The whole thing is just 1500 lines long. Google Maps does all the real work.
86 |
87 | It doesn't need a framework. It doesn't need a build system. It doesn't even need jquery. [Vanilla JS](http://vanilla-js.com/) is more than enough.
88 |
89 | #### Why is the code so bad?
90 | I'm a video game programmer. I don't know how to write idiomatic JavaScript. I tried my best to keep things easy to understand. Dynamic languages are hard.
91 |
92 |
93 | Examples
94 | ===
95 |
96 | Here is some example output produced by my tool. For a more detailed look please read my [blog post](https://blog.forrestthewoods.com/visualizing-commute-times-378009330ffa).
97 |
98 | ### South Lake Union
99 |
100 | South Lake Union is a booming Seattle neighborhood. Located within are offices for Amazon, Google, Facebook, and more. Here is what it looks like to commute to South Lake Union at 8:00 am.
101 |
102 | 
103 | 
104 | 
105 | 
106 | 
107 |
108 | ### Kenmore, Wa
109 |
110 | A few years ago I lived in the Seattle suburb of Kenmore. Located at the northern tip of Lake Washington it allows for access to both the west and east side. Even better there's a large park and ride transit hub. Here's what it looks like to commute from Kenmore at 8:00 am.
111 |
112 | 
113 | 
114 | 
115 |
116 |
--------------------------------------------------------------------------------