Matching Real Time GPS Data to the Timetable

214 views
Skip to first unread message

Rob Commons

unread,
Sep 20, 2016, 12:23:01 PM9/20/16
to A gathering place for the Open Rail Data community
Hi All, 

I am hoping someone can help with a problem I am having. 

I have access to the NR Schedule data feed that gives me the daily timetable. I also have real time GPS movement data from an external source which simply contains the location and speed of a train. 

My question is - how can I reliably match the GPS data to the timetabled run if no headcode exists within the GPS data? Is there any further data feeds (TRUST perhaps?) that can be used in conjuction with my current set up to match the GPS run with a headcode and therefore the timetabled run? 

I notice that the website http://www.realtimetrains.co.uk/ manages to successfully complete this matching of real train movements to timetabled runs, but I am not sure how!

Any help on the above would be greatly appreciated. 


Many Thanks, 

Rob

Rob Commons

unread,
Sep 20, 2016, 12:27:01 PM9/20/16
to A gathering place for the Open Rail Data community
One small edit: The GPS data contains speed, gps co-ordinates and, importantly, the timestamp of each data point.

Thanks, 

Rob.

Peter Hicks

unread,
Sep 20, 2016, 12:28:20 PM9/20/16
to Rob Commons, A gathering place for the Open Rail Data community
Hi Rob

On 20 Sep 2016, at 17:23, Rob Commons <robert....@cogitare.biz> wrote:

I am hoping someone can help with a problem I am having. 

I have access to the NR Schedule data feed that gives me the daily timetable. I also have real time GPS movement data from an external source which simply contains the location and speed of a train. 

My question is - how can I reliably match the GPS data to the timetabled run if no headcode exists within the GPS data? Is there any further data feeds (TRUST perhaps?) that can be used in conjuction with my current set up to match the GPS run with a headcode and therefore the timetabled run? 

This is a complex area, and the industry has a GPS Gateway which aggregates GPS data from trains and provides additional TRUST reports (the ones with an arrow on http://www.opentraintimes.com/schedule/Y17697/2016-09-20 for example) for GPS-fitted trains based on their position and other data.

It might help to explain some more about the work you’re trying to do, and the context it sits in, as it’s entirely possible you’ll need other data sources.

I notice that the website http://www.realtimetrains.co.uk/ manages to successfully complete this matching of real train movements to timetabled runs, but I am not sure how!

I’m not sure RealTimeTrains actually uses raw GPS data.  There was something on http://www.realtimepres.com/ about using GPS to track preserved railway movements in real-time, but it looks like that’s not actually a thing any more, as I can’t load the login page.


Peter


Rob Commons

unread,
Sep 20, 2016, 12:44:39 PM9/20/16
to A gathering place for the Open Rail Data community, robert....@cogitare.biz
Hi Peter, 

Thanks for the quick response!

Yes no problem - I am developing software that simulates train runs in real time to calculate and suggest new ways in which they can be driven to save fuel and ensure on time running. The detailed GPS data is not the issue, I can get this from a different source. The problem comes when I need to find out what the timetable was for each run. This is required to see if the train is running on time or not, as this affects the advice that may be given (the train must not go slower if already late for example). The GPS data does not include any headcode information, only train unit numbers. Therefore I am looking for a way to match the running times in the GPS data, which are only labelled with unit number, with either with the headcode (through TRUST or some other data source), or with the timetable directly.

Thanks,

Rob.

Peter Hicks

unread,
Sep 20, 2016, 1:26:19 PM9/20/16
to Rob Commons, A gathering place for the Open Rail Data community
Hi Rob

On 20 Sep 2016, at 17:44, Rob Commons <robert....@cogitare.biz> wrote:

Yes no problem - I am developing software that simulates train runs in real time to calculate and suggest new ways in which they can be driven to save fuel and ensure on time running. The detailed GPS data is not the issue, I can get this from a different source. The problem comes when I need to find out what the timetable was for each run. This is required to see if the train is running on time or not, as this affects the advice that may be given (the train must not go slower if already late for example). The GPS data does not include any headcode information, only train unit numbers. Therefore I am looking for a way to match the running times in the GPS data, which are only labelled with unit number, with either with the headcode (through TRUST or some other data source), or with the timetable directly.

It sounds like DAS or a variant thereof.

To match a unit number to a train, you need access to unit allocation data which is held in GEMINI.  This is difficult and/or expensive to get access to, but if you’re working with a TOC, maybe they can upload their resource diagrams to you so you can match a unit to a train.

Another way you could do it is by looking at departures from an origin location and linking the unit to the train based on no other candidate trains.  For example, if you have a GPS report from a train departing Charing Cross at 1816, and there was also a TRUST report for the on-time departure of train 882N58MV20, you could say that unit 465123 could be on this service.  If you have multiple departures from the same location, it gets a bit more difficult, but you could build up some basic geofences around particular locations.

Yet another way is to have the driver selecting their train schedule.  GPS can tell you the train is at Charing Cross, and you could return a list of services at Charing Cross and allow the driver to select.


Peter

Rob Commons

unread,
Sep 21, 2016, 4:17:43 AM9/21/16
to A gathering place for the Open Rail Data community, robert....@cogitare.biz
Hi Peter, 

Okay, great. Thanks, that's much appreciated.

We are not currently at the stage where the driver can input information in real time so I will talk to the TOCs we are involved with to see if Gemini/Resource Diagrams are an option, and will look further into the no other candidate trains option, as that's probably the best bet at the moment. I may come back to you if I have any problems with the TRUST feed if that's okay?

Thanks again!

Rob

Rob Machon

unread,
Sep 29, 2016, 11:15:45 AM9/29/16
to A gathering place for the Open Rail Data community, robert....@cogitare.biz
Be aware that not all TOCs use GEMINI. Also, where set swaps take place the GEMINI database can lag behind events, so you might be given a unit/train linkage that's incorrect. Sadly, this is most likely when the service is disrupted and the information is most useful.

Rob.

Rob Commons

unread,
Sep 30, 2016, 8:24:20 AM9/30/16
to A gathering place for the Open Rail Data community, robert....@cogitare.biz
Hi Rob, 

Okay, thanks, I will keep that in mind. 

Cheers, 

Rob

djbur...@gmail.com

unread,
Oct 3, 2016, 8:00:16 AM10/3/16
to A gathering place for the Open Rail Data community, robert....@cogitare.biz
Hi Rob,

I worked on a very similar issue years ago, before it was so easy to get hold of real time information:-) Back then it was a case of matching GPS co-ords to nearest known locations (i.e. stations), then working through trying to find a matching service, allowing for early/late/non running. We had a feed telling us when the train doors were open, thus we knew we were at a station - otherwise you have to allow for junctions (where the nearest station may be on a different line!).

These days, all the information is there, you just need to be able to match the various sources. You have GPS co-ords: CORPUS location data should help you turn these into nearest stations. You have TRUST which gives you actual running information at these known locations (TD gives you greater granularity but I'm not sure if there is any data source in the public domain giving the GPS co-ords of berths). TRUST also gives you the schedule (head)codes - and by looking at the SCHEDULE feed you should be able to work back to a timetabled run.

Out of interest, are you able to say which TOC this is for?
Regards,
Dave
Reply all
Reply to author
Forward
0 new messages