Sydney Train real-time position stop_id/stop_sequence


I am trying to figure out the train’s current location/stop information (Sydney Train) from the realtime position data. I am unsure how to interpret the “stop_id” and “stop_sequence” in the Sydney Trains real-time position feed.

It seems the stop_sequence is always 0 while the stop_id has strings such as stop_id: “Mountains.KT22 Loc” which I am unable to find in the stops.txt file from the timetables. I am trying to location the train in its current trip/stop sequence.

entity {
id: “198”
vehicle {
trip {
trip_id: “W564.1389.125.4.V.4.62617941”
schedule_relationship: SCHEDULED
route_id: “BMT_2”
position {
latitude: -33.709732
longitude: 150.30968
timestamp: 1595827191
stop_id: “Mountains.KT22 Loc”
vehicle {
id: “1625.6407.5309.4261”
label: "15:29 Katoomba Station to Central Station "

Thanks for your help !

Hi, thanks for the question. The stop_id you have noted is a point on Sydney Trains nodal geography, I will ask internally to see if we can get a reference table of all the locations.

In this particular example the coordinates indicate the train is near Katoomba, and you can use the lat/long as a starting point.

Hi David,

Thanks for your response.

I think I cleared up one of my own confusion. The real-time position data for Ferry/Metro/LightRail has “current_stop_sequence” and “stop_id” fields, while Sydney Trains has only the “stop_id”. I used the same schema to import the the data hence “current_stop_sequence” field is always zero in my database.

However, the stop_id is still somewhat of a mystery to me. For the other vehicles such as Ferry, Metro and LightRail, the “stop_id” matches to stop_id in stops.txt. I am not sure how to decipher the stop_id for the Sydney Trains ?

What I am doing is trying to map out the train’s trip in terms of stop sequence from the first stop to the last. With the “current_stop_sequence” or “stop_id” I can locate the train in its stop sequence. I’ve extracted the stop sequences for from the schedule information ie stop_times.txt using the trip_id.

Hoping there is an easier way to identify the train’s previous/next stop information like in the Ferry/Metro/Lightrail data other than using the lat/long data.

Thanks for your help.


Just wondering if anyone can share some light on the stop_id query, it will be extremely helpful !


© Transport for NSW