Chris Zetter

Visualizing Changes to Rail Services

This post is about the Timetable Changes tool I built to help understand how upcoming changes to the train timetables in the UK would affect me.

The May 20th changes

From Sunday 20th May 2018 a lot of the timetables for rail services in the UK are changing. For some routes the changes are small. For others, particularly in the South-East, the changes are more dramatic. Great Northern, Thameslink and Southern services are all changing as part of the Thameslink Program.

For Great Northern (the service I use), this means that all services have been re-timed and many trains will now go through St Pancras and Central London rather than terminating at Kings Cross.

PDF timetables

As someone who uses trains almost every day, I wanted to see how the journeys I make would be affected. I tried looking up the new services using a journey planner and on the hard to follow PDF timetables but neither gave me the insight I wanted to know- I didn’t care if the 7:46 morning service departed 3 minutes later, what I did care about was how the general frequency and journey time of the new services compared to what they were like now.

This is one A3 page of the new 18 page PDF timetable available from RailPlan20/20.

Marey-style diagrams

I remembered seeing graphical displays of train schedules in Edward Tufte’s The Visual Display of Quantitative Information. This style of diagram was first used by E.J Marey to display train services in the 1880s.

Marey's diagram from La méthode graphique dans les sciences expérimentales et principalement en physiologie et en médecine shows train services between Paris and Lyon. The horizontal axis shows time, and the vertical shows the stops.

This diagram lets you compare the arrival and departures times of many services at a glance. The slope of each line also gives an indication of the relative speed of a service. More recently Marey-style diagrams have been used to visualize data from the Boston Subway and to help investigate a problem with a train on Singapore’s MRT.

Showing the services

Taking inspiration from Marey, I was able to display the timetables in the way that I wanted. I retrieved the timetable data I needed from the transportapi service and used D3.js to display it. By drawing the chart for the new timetable below the current one I made it easier to compare the two.

I choose to grey-out services that were overtaken since you would normally wait for next faster service rather than travelling on them.

Showing journeys from London Kings Cross and St Pancras to Hitchin in the evening peak.

The new chart shows me exactly what I want, and I can begin to see patterns in the service which weren’t obvious before. For instance, the worst time to get to Kings Cross/St Pancras would be after the 17:54 service has departed since it has the longest gap until the next one.

Another journey I often make is from Moorgate to Finsbury Park. I can now see that journeys take an extra minute in the new timetable, and there's an extra train every 30 minutes.

You can use the tool yourself to produce charts for any direct rail journey in the UK. The code is also available on Github.

Read more by me, follow me on twitter or subscribe.