Displaying transit times on a map (Munich/MVV)

A personal (but techy) project I’ve been doing on the side recently has just reached a milestone.
Some time in the next year we are going to move out of the city centre.  I want to live as far away from the concrete jungle, rumbling juggernauts and grumpy people as I can, but… it would be nice not to be too far away from friends, activities and shopping….

There are many parameters involved (and in time I will put them all on a map!), but probably the most important one is that our new home must be within a reasonable transit time by public transport of the city centre.  But reasonable is relative… if the new place is great it could be 40 minutes, for “ok” it would have to be less than 30, and “fantastic” might get us to stretch to 50 minutes.  The trips shouldn’t have a frequency (during the day) of more than 20 minutes either, otherwise we’d always be missing/waiting for a train…

So how can I visualise these regions on a map?

  1. Write an interface to the MVV (the public transport provider in Munich) web interface.  Unfortunately they don’t have a documented API, but they do have a RESTful interface, and a Java interface already exists (thanks Andreas!).  Between that and some further reverse engineering it wasn’t too difficult.  I’ll be publishing that module soon too. 🙂
  2. Localise all the stops in the region, and determine the transit times, and frequencies from the central station (Munich Hauptbahnhof) to each of the stops.  Throw all that data into a database for easy access. (SQLite is your friend).
  3. Write a Perl interface to Google Fusion Tables (there are interfaces in Python and PHP already, but I prefer Perl…).
  4. Analyse the data, generate polygons around each stop indicating the distance you could walk (assuming 4kmh average walking speed) from that stop after having travelled from the central station, within a time limit (10 minutes, 20 minutes, …)
  5. Convert the polygons to KML (that’s an XML variant which google uses for representing geographic data).
  6. Upload the polygons to Fusion tables
  7. Do some tweaking with the colouring so that the data is visually appealing and understandable.
The result is pretty, colourful, zoomable, responsive, and more importantly: shows me exactly what I want to see in a way which numbers in a table never could have: (click here to pop-out)

For my next party trick I’ll be putting proximity to shopping centres, parks on the map, and possibly doing the same representation for transit time with a car.  Any other ideas what would be relevant, and pretty on the map?


You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

3 Responses to “Displaying transit times on a map (Munich/MVV)”

  1. […] from the center to other city destinations. Robin Clarke created the following map and describes in this post how he did it. Munich transit system Isochrone Map (Source: Robin […]

  2. Hello Robin,

    do you know any possibility to choose any adress/street or tube station (e.g. “Freimann”) in Munich for this analysis instead of central station?

    I’m not keen on programming. I was just looking for the topic isochrome map related to Munich.

    Regards
    Niels

  3. Hi Niels,

    Of course it is possible to generate an isochrome map for transit times from any stop on the MVV network. Requesting the transit times for any given stop requires a query to all (over 4000) stops in the MVV network from the stop you are interested in, and that is quite a significant load on the MVV servers (I imagine…). So while it would theoretically be possible to generate an isochrome map for each stop in the MVV network, the data volume (4000 x 3999 x 3998 …) and load on the MVV servers would not justify it. For that it would make more sense to query the times between all adjacent stops, put that in a graph database, and … that’s another, much bigger project! 🙂

    Best regards,
    -Robin-