Real-time data format

#1

I am planning to create a real-time transport mobile app and website sort of like anytrip created by @jxeeno.
My plan is to create a C#.net executable to run as scheduled job to get both static and real-time data and push into MySQL DB.
And another RESTful service developed in C#.Net to serve data for website and mobile app.
Bit struggling with understanding the format of real-time data received from TfNSW APIs for Trains, any help would be much appreciated.
Is there any pointer for data structure/format for Sydney Trains, like how to indentify the Train route, delay, carriages, geo position and any other alerts like Track work?
I am specific to Trains api since the proto is bit different to standard format.

Many Thanks.

#2

Hi Muthu,

That sounds like a fairly good approach. What have you tried in terms of getting the data and processing the data. Have you got it working for other GTFS/GTFS-realtime feeds?

#3

Hi Ken,
For static data (GTFS) i do it manually for now - download the zip file and import into DB.
For realtime feeds, i tried for buses and sydney trians, i could understand the format but stuck with linking all data into one piece, for example not sure how to display the Stop name - for buses its street name + suburb name. Where to find geolocation info so that we can search for all services in that area - as you do in anytrip map view.
Thanks.

#4

I managed to understand the formats reading the documents few times.
Technical document says
“Times for trips starting before 04:00 am will be expressed in ‘36
hour format’.
For example: “25:07” (01:07 am)”

But i can see time with even 41hrs as below

Bit confused.

#5

Hi Muthu,

The GTFS spec doesn’t require the times to be “<36 hours”. You can check it here: https://developers.google.com/transit/gtfs/reference/#stop_timestxt

It also looks like you’re using the Complete GTFS bundle which doesn’t currently match with data provided in the real-time data feeds. You can find the real-time GTFS bundles here: https://opendata.transport.nsw.gov.au/dataset/public-transport-timetables-realtime

#6

Hi Ken,

" The GTFS spec doesn’t require the times to be “<36 hours”. You can check it here: https://developers.google.com/transit/gtfs/reference/#stop_timestxt"

Ok, got it. Since in TfNSW document it says 36 hours format, i was expecting values under 36.

"It also looks like you’re using the Complete GTFS bundle which doesn’t currently match with data provided in the real-time data feeds. "

Yes, downloading the zip file of Complete GTFS bundle manually and analysing.
It does not match with real-time data feeds? OK. Somehow i missed this key information.

Thanks very much Ken. I really appreciate your help.

TfNSW real-time map