[iRail] AppsForGhent Travel-time maps

Jan Fabry jan.fabry at monkeyman.be
Sat May 14 20:48:30 UTC 2011


Hello there,

Today we created a little app for the AppsForGhent open data hackathon that Pieter organized.

We were inspired by the "travel-time maps" created by MySociety in 2006 and 2007. They indicate on a map how far certain locations are by public transport. You can find simple examples at [ http://www.mysociety.org/2006/travel-time-maps/ ] and more advanced examples at [ http://www.mysociety.org/2007/more-travel-maps/ ] (especially the "House prices" demo).

Generating such nice maps requires a lot of post-processing to go from nodes (stations) to areas, so we went for a simpler solution to finish in time. I stumbled upon this Travel Time Tube map of the London Underground [ http://www.tom-carden.co.uk/p5/tube_map_travel_times/applet/ ], which moves the stations depending on the travel time. It is built in Processing, which is based on Java, and the code was simple enough for me to understand :-)

Tim did the heavy lifting of converting the static dump to stop-to-stop travel time, while I figured out how to rip out the unnecessary code and add the extra stuff we need (interesting since it was my first real project in Processing). Yeri meanwhile scraped the website manually to get the route colors.

In the end we created something that resembles the tube map for the Ghent area. Because there are many more stops and connections the experience is not really the same, but it shows a possible direction.

On the way home I played further with it and improved the code (which was not really efficient), and added some extra features. You can see the current state at [ http://monkeyman.be/traveltimemap/ ]. Maybe you need to unfocus and focus your browser again to get it working (you should see labels when you move the mouse over the stations). Click a station to make it the center of the time-warped map. Click "g" to return to the geographical rendering. Click "w" to disable time-warping, and only see the station coloring (the closer to red the longer it takes to get there). Disabling time-warping only works when you do it as the first operation, that was a late addition.

You can download the code with the links at the bottom. Playing with Processing is fun, so I recommend you to do so. The datafiles are not included, but you can find them in the complete .jar.

That's all for today, tomorrow you can find me behind the "sjoelbakken" at the Mater Dei school in Genk. Always welcome!

Greetings,

Jan


More information about the iRail mailing list