Does anyone have .proto file for Real-Time public Transport Data?


#1

Hi, guys.

I have been working with Real-Time Public Transport Data.

As you know, server responses the file in the format of Google’s Protocol Buffers.

To extract data, it is needed to de-serialize data, but after compiling, it fails to extract data.

This is my .proto file.

Does anyone have worked with this before?

syntax = "proto2";

package PKGTripTable;

message StopTimeEvent {
	optional int32 delay = 1;
	optional uint32 time = 2;
}

enum ScheduleRelationship {
  SCHEDULED = 0;
  SKIPPED = 1;
  NO_DATA = 2;
}

message TripDescriptor {
	optional string trip_id = 1;
	optional string start_time = 2;
	optional string start_date = 3;
    optional ScheduleRelationship schedule_relationship = 4;
	optional string route_id = 5;
}

message Vehicle {
	optional string id = 1;
	extensions 1000 to 1999;
}

message StopTimeUpdate {
	optional uint32 stop_sequence = 1;

	optional StopTimeEvent arrival = 2;

	optional StopTimeEvent departure = 3;

	optional string stop_id = 4;

	optional ScheduleRelationship schedule_relationship = 5;

}

message TripUpdate {

	optional TripDescriptor trip = 1;

	repeated StopTimeUpdate stop_time_update = 2;

	optional Vehicle vehicle = 3;

	extensions 1000 to 1999;

}

message Entity {
	optional string id = 1;

	optional TripUpdate trip_update = 2;

}

message Header {
	optional string gtfs_realtime_version = 1;
	optional string incrementality = 2;
	optional int32 timestamp = 3;
}

message TripTable{

    optional Header header = 1;

    repeated Entity entity = 2;
}

And this is the extracted data I have done so far:

'header':  {'gtfs_realtime_version': u'1.0', 'timestamp': 1475115721}
'entity':  {'id': u'33553_11128750_2436_619'}
'entity':  {'id': u'33553_11129065_2436_619_1'}
'entity':  {'id': u'33553_11129066_2436_619'}
'entity':  {'id': u'33553_11128943_2436_619'}
'entity':  {'id': u'33553_11128942_2436_619_1'}
'entity':  {'id': u'33553_11128698_2436_619_1'}
...

#2

answered in the other thread

try this http://opendata.transport.nsw.gov.au/forum/t/illegal-value-error-when-decoding-sydneytrains-gtfs-data/149/5


#3

Many many thanks!!!

You saved my life!!!

Thanks again.


#4

Hi

By the way I am wondering if I could get data for some bus-stop only, not for all data.

Is there any parameters I could put to get data of a route/bus-stop?

I am eager to hear from you soon.

(Thanks again…)


#5

At the moment it’s all or nothing but @yvonne.lee will probably have some more info.


#6

You will have seen a post previously where you can get it down to one bus contract region. http://opendata.transport.nsw.gov.au/forum/t/getting-timetable-data-of-a-bus-stop/320/3

That’s all we have for now. We are looking at building more APIs in future that provide a parameter / return such as what you are after. We can add it to our backlog.

For now, I know some of the other developers here have APIs provided from consuming the data and they may be able to provide the granularity you need.