Real-time Trip Update data seems to be truncated

Hi, guys.

I have been working with Real Time Trip Update data for 2 days.

What I have done is this:

I could successfully get response data in the format of zip file.

After extracting zip file, I could get tripupdate.txt.

Last week I could find the data of the Bus stop:

Its stop id is 200916.
It has 2 route (389 and 501) and their route id is 2441_389 and 2441_389

By the way I cannot find anything of these route id this week.

Seems like response data is truncated.

I have seen that the last part of the file is like this:

Please help me!

I have attached the tripupdate.txt file I had downloaded.

Hi,

If you look at the API documentation it states that the text format may be truncated. It’s a GTFS Realtime feed so you’ll need to consume the Protocol Buffers with more info available over at Protocol Buffers  |  Google Developers.

Cheers,
Alistair

1 Like

Hi, phiali.
Thanks for your quick reply!

Yeah, I have forgotten to mention that I had used debug mode.

I tried to use protobuf with python, but finally failed to extract data.

Though I had followed their user guide exactly, I could not compile it.

Is there any .proto file for this data type?

Thanks again.

P.S. this is the proto file I had created.

syntax = "proto2";

package PKG_TripUpdate;


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

    message Entity {
	required string id = 1;
	message TripUpdate {
		message Trip {
			required string trip_id = 1;
			optional string start_time = 2;
			optional string start_date = 3;
			optional string schedule_relationship = 4;
			optional string route_id = 5;
		}
		required Trip trip = 1;
		
		message StopTimeUpdate {
			optional int32 stop_sequence = 1;
			
			message Arrival {
				optional int32 delay = 1;
				optional int32 time = 2;
			}
			optional Arrival arrival = 2;
			
			message Departure {
				optional int32 delay = 1;
				optional int32 time = 2;
			}
			optional Departure departure = 3;
			
			optional string stop_id = 4;
			
			optional string schedule_relationship = 5;
			
		}
		repeated StopTimeUpdate stop_time_update = 2;
		
		message Vehicle {
			optional string id = 1;
			optional string no_1999 = 2;
		}
		optional Vehicle vehicle = 3;
		
		optional int32 no_4 = 4;
		
	}
	required TripUpdate trip_update = 2;
	
    }
    repeated Entity entity = 2;
}

Yeah the debug mode is useful but it’ll eventually become truncated so wouldn’t base any real work on that.

Did you try the version available from Google over at GTFS Realtime Protobuf  |  Realtime Transit  |  Google Developers? I’m sure I used that one, along with the PHP bindings (GitHub - MobilityData/gtfs-realtime-bindings-php) and got it to work.

Thanks for your advice, phiali.

Unfortunately, the python wrapper which is compiled from GTFS Realtime Protobuf  |  Realtime Transit  |  Google Developers has failed to extract data.

But other python wrapper which is compiled from my .proto file above has succeeded to extract entity. But it has failed to extract inside the Entity (TripUpdate)

Seems like something is wrong in my .proto file.

Thanks. again.

Yuri.

P.S. This is updated .proto file.

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;
}

hey guys there is actually a different proto file…

try this Illegal value Error when decoding SydneyTrains GTFS data - #5 by yvonne.lee - Real-time Public Transport - Open Data - Transport for NSW forum