forked from MobilityData/gtfs-realtime-bindings
-
Notifications
You must be signed in to change notification settings - Fork 1
/
transit-extensions.proto
122 lines (90 loc) · 3.67 KB
/
transit-extensions.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
//
// Transit Extensions for the GTFS-realtime protocol.
//
// Using private extension ID 9514. Has to be between 9000 and 9999
syntax = "proto2";
import "gtfs-spec/gtfs-realtime/proto/gtfs-realtime.proto";
import "agency-extensions/tfnsw-vehicle.proto";
import "agency-extensions/mtas-realtime.proto";
message TransitAlertExtension {
// Create time of the alerts, in POSIX time
required uint64 created_at = 1;
// Transit's source name for that alert's agency
optional string source_name = 2;
// Flag for automatically generated service change alerts
optional bool is_service_change_alert = 3;
}
extend transit_realtime.Alert {
optional TransitAlertExtension transit_alert_extension = 9514;
}
message TransitInformedEntityExtension {
// Transit's feed id for that alert
optional int32 feed_id = 1;
// Transit's global route id related to the routeId
optional int32 global_route_id = 2;
// Transit's stable stop id related to the stopId
optional int32 stable_stop_id = 3;
}
extend transit_realtime.EntitySelector {
optional TransitInformedEntityExtension transit_entity_selector_extension = 9514;
}
message TransitVehicleDescriptorExtension {
// If that vehicle information is based on crowd information
optional bool based_on_crowdsourcing_data = 1;
// VehicleId in the transitBackend that generated that prediction
optional string transit_vehicle_id = 2;
}
extend transit_realtime.VehicleDescriptor {
optional TransitVehicleDescriptorExtension transit_vehicle_descriptor_extension = 9514;
}
message TransitTripDescriptorExtension {
enum OriginPrediction {
// Prediction comes from the agency's original feed
AGENCY_ORIGINAL_DATA = 0;
// Prediction comes from Transit's prediction engine
TRANSIT_PREDICTION_ENGINE = 1;
}
// Who generated the prediction
optional OriginPrediction origin_prediction = 1 [default = AGENCY_ORIGINAL_DATA];
// Timestamp when the prediction was made, in POSIX time
optional uint64 prediction_made_at = 2;
}
extend transit_realtime.TripDescriptor {
optional TransitTripDescriptorExtension transit_trip_descriptor_extension = 9514;
}
message TransitStopTimeUpdateExtension {
enum PredictionAlgorithm {
// Prediction comes from Machine Learning
ML = 0;
// Prediction comes from Recency
RECENCY = 1;
// Prediction comes from Deterministic logic, like first stop of the trip
DETERMINISTIC = 2;
// Prediction comes from Propagating to the next trip
PROPAGATION = 3;
}
// If the prediction should be kept in the app until it receives an update from the server saying
// that the vehicle is past the stop. Should not assume that the vehicle is past the stop until
// the server says so
optional bool should_not_assume_vehicle_is_past = 1;
// What was the algorithm source of the prediction
optional PredictionAlgorithm prediction_algorithm = 2;
}
extend transit_realtime.TripUpdate.StopTimeUpdate {
optional TransitStopTimeUpdateExtension transit_stop_time_update_extension = 9514;
}
// Include Transport for New South Wales' extension for Air Conditioning
// and accessibility info.
extend transit_realtime.VehicleDescriptor {
optional TfnswVehicleDescriptor tfnsw_vehicle_descriptor = 1999;
}
// Include MTAS for more detail on the real time feeds
extend transit_realtime.FeedHeader {
optional NyctFeedHeader nyct_feed_header = 1001;
}
extend transit_realtime.TripDescriptor {
optional NyctTripDescriptor nyct_trip_descriptor = 1001;
}
extend transit_realtime.TripUpdate.StopTimeUpdate {
optional NyctStopTimeUpdate nyct_stop_time_update = 1001;
}