-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgtfs-realtime.pb.rb
227 lines (189 loc) · 4.81 KB
/
gtfs-realtime.pb.rb
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
## Generated from gtfs-realtime.proto for transit_realtime
require "beefcake"
class FeedMessage
include Beefcake::Message
end
class FeedHeader
include Beefcake::Message
module Incrementality
FULL_DATASET = 0
DIFFERENTIAL = 1
end
end
class FeedEntity
include Beefcake::Message
end
class TripUpdate
include Beefcake::Message
class StopTimeEvent
include Beefcake::Message
end
class StopTimeUpdate
include Beefcake::Message
module ScheduleRelationship
SCHEDULED = 0
SKIPPED = 1
NO_DATA = 2
end
end
end
class VehiclePosition
include Beefcake::Message
module VehicleStopStatus
INCOMING_AT = 0
STOPPED_AT = 1
IN_TRANSIT_TO = 2
end
module CongestionLevel
UNKNOWN_CONGESTION_LEVEL = 0
RUNNING_SMOOTHLY = 1
STOP_AND_GO = 2
CONGESTION = 3
SEVERE_CONGESTION = 4
end
end
class Alert
include Beefcake::Message
module Cause
UNKNOWN_CAUSE = 1
OTHER_CAUSE = 2
TECHNICAL_PROBLEM = 3
STRIKE = 4
DEMONSTRATION = 5
ACCIDENT = 6
HOLIDAY = 7
WEATHER = 8
MAINTENANCE = 9
CONSTRUCTION = 10
POLICE_ACTIVITY = 11
MEDICAL_EMERGENCY = 12
end
module Effect
NO_SERVICE = 1
REDUCED_SERVICE = 2
SIGNIFICANT_DELAYS = 3
DETOUR = 4
ADDITIONAL_SERVICE = 5
MODIFIED_SERVICE = 6
OTHER_EFFECT = 7
UNKNOWN_EFFECT = 8
STOP_MOVED = 9
end
end
class TimeRange
include Beefcake::Message
end
class Position
include Beefcake::Message
end
class TripDescriptor
include Beefcake::Message
module ScheduleRelationship
SCHEDULED = 0
ADDED = 1
UNSCHEDULED = 2
CANCELED = 3
end
end
class VehicleDescriptor
include Beefcake::Message
end
class EntitySelector
include Beefcake::Message
end
class TranslatedString
include Beefcake::Message
class Translation
include Beefcake::Message
end
end
class FeedMessage
required :header, FeedHeader, 1
repeated :entity, FeedEntity, 2
end
class FeedHeader
required :gtfs_realtime_version, :string, 1
optional :incrementality, FeedHeader::Incrementality, 2, :default => FeedHeader::Incrementality::FULL_DATASET
optional :timestamp, :uint64, 3
end
class FeedEntity
required :id, :string, 1
optional :is_deleted, :bool, 2, :default => false
optional :trip_update, TripUpdate, 3
optional :vehicle, VehiclePosition, 4
optional :alert, Alert, 5
end
class TripUpdate
class StopTimeEvent
optional :delay, :int32, 1
optional :time, :int64, 2
optional :uncertainty, :int32, 3
end
class StopTimeUpdate
optional :stop_sequence, :uint32, 1
optional :stop_id, :string, 4
optional :arrival, TripUpdate::StopTimeEvent, 2
optional :departure, TripUpdate::StopTimeEvent, 3
optional :schedule_relationship, TripUpdate::StopTimeUpdate::ScheduleRelationship, 5, :default => TripUpdate::StopTimeUpdate::ScheduleRelationship::SCHEDULED
end
required :trip, TripDescriptor, 1
optional :vehicle, VehicleDescriptor, 3
repeated :stop_time_update, TripUpdate::StopTimeUpdate, 2
optional :timestamp, :uint64, 4
end
class VehiclePosition
optional :trip, TripDescriptor, 1
optional :vehicle, VehicleDescriptor, 8
optional :position, Position, 2
optional :current_stop_sequence, :uint32, 3
optional :stop_id, :string, 7
optional :current_status, VehiclePosition::VehicleStopStatus, 4, :default => VehiclePosition::VehicleStopStatus::IN_TRANSIT_TO
optional :timestamp, :uint64, 5
optional :congestion_level, VehiclePosition::CongestionLevel, 6
end
class Alert
repeated :active_period, TimeRange, 1
repeated :informed_entity, EntitySelector, 5
optional :cause, Alert::Cause, 6, :default => Alert::Cause::UNKNOWN_CAUSE
optional :effect, Alert::Effect, 7, :default => Alert::Effect::UNKNOWN_EFFECT
optional :url, TranslatedString, 8
optional :header_text, TranslatedString, 10
optional :description_text, TranslatedString, 11
end
class TimeRange
optional :start, :uint64, 1
optional :end, :uint64, 2
end
class Position
required :latitude, :float, 1
required :longitude, :float, 2
optional :bearing, :float, 3
optional :odometer, :double, 4
optional :speed, :float, 5
end
class TripDescriptor
optional :trip_id, :string, 1
optional :route_id, :string, 5
optional :start_time, :string, 2
optional :start_date, :string, 3
optional :schedule_relationship, TripDescriptor::ScheduleRelationship, 4
end
class VehicleDescriptor
optional :id, :string, 1
optional :label, :string, 2
optional :license_plate, :string, 3
end
class EntitySelector
optional :agency_id, :string, 1
optional :route_id, :string, 2
optional :route_type, :int32, 3
optional :trip, TripDescriptor, 4
optional :stop_id, :string, 5
end
class TranslatedString
class Translation
required :text, :string, 1
optional :language, :string, 2
end
repeated :translation, TranslatedString::Translation, 1
end