Sorry, TrainMapper is not yet available for public download.
TrainMapper is an application which displays the current positions of various UK trains on a map.
The application uses live train status information which is publicly available on the internet. For each train, it analyses the latest departure and arrival data, and
then calculates the approximate geographical position, which is then plotted on the map. If a train is reported to be delayed or cancelled, the map is updated accordingly.
I’ve made two different versions of TrainMapper. Version 1 (completed in January 2009) is a
web application, while version 2 (completed in February 2009) is a
Java application.
This is a time-lapse video of TrainMapper v1, recorded on Wednesday 14th January 2009. A 24-hour clock is displayed in the top-left corner, and the video runs about
242 times faster than real-time.
I highly recommend you watch this video in fullscreen mode, to enable you to read the station names on the map.
Click on this button in the YouTube player to watch the video fullscreen.
I wrote TrainMapper v1 in about 470 lines of
JavaScript and 350 lines of
PHP, and it uses
XHR/AJAX
to automatically obtain the latest train data from the webserver every few seconds.
When a train is reported to be delayed, you’ll see it “jump” forwards or backwards as its position is recalculated.
Unfortunately, no live train status information is available after midnight, so all the trains disappear from TrainMapper at that time (even though trains are still running until about 2am).
The video was created using an AppleScript which took periodic
PNG screenshots of TrainMapper running in
Safari (click
here for the actual script used). These screenshots were then converted into a movie using the following
MEncoder command:
This is a time-lapse video of TrainMapper v2, recorded on Thursday 19th February 2009. A 24-hour clock is displayed in the top-left corner, and the video runs about
125 times faster than real-time.
I highly recommend you watch this video in fullscreen mode, to enable you to read the station names on the map.
Click on this button in the YouTube player to watch the video fullscreen.
I wrote TrainMapper v2 in about 3,000 lines of
Java. It contains a database of all 189 stations which can be reached by
direct trains from London Waterloo, and it displays all trains which arrive at and depart from
Waterloo. In the time-lapse video above, a total of 756 trains arrive, and 758 trains depart.
This is the map of the South West Trains lines from London Waterloo, used by TrainMapper v2.
Click to view the full-size version.
The map shows the following train lines in the south-west of London:
Only 99 of the stations on these lines are visible on the map (the other 91 are off the edges of the map).
Version 2 contains several improvements compared to version 1, including:
15 train lines are now displayed, instead of just 2.
The train lines are now colour-coded.
Trains now travel from one station to the next using a sinusoidal movement, instead of moving at constant
speed. This makes the trains’ movements more realistic.
Trains no longer disappear from the map at midnight. Although no live train status information is available after midnight, TrainMapper stores the information it obtained
before midnight, and uses this to continue displaying trains.