Show last authors
1 = SIRI MonitoredVehicleJourney Element=
2
3 The SIRI ##MonitoredVehicleJourney## element contains most of the relevant real-time information about particular vehicles in the MTA Bus Time system. It is used by the responses to both the [[VehicleMonitoring>>Developers.SIRIVehicleMonitoring]] and [[StopMonitoring>>Developers.SIRIStopMonitoring]] calls. As much as possible, the values in a ##MonitoredVehicleJourney## element correspond to the values in the MTA's GTFS data.
4
5 The XML below illustrates the SIRI MonitoredVehicleJourney element. Other notes on the contents of a ##MonitoredVehicleJourney## follow the example.
6
7
8
9 ##
10 <MonitoredVehicleJourney>
11 \\
12 <!~-~- The 'fully qualified' route name (GTFS agency ID + route ID) for the trip the vehicle is serving. Not intended to be customer-facing. ~-~->
13 <LineRef>MTA NYCT_B63</LineRef>
14 \\
15 <!~-~- The GTFS direction for the trip the vehicle is serving ~-~->
16 <DirectionRef>1</DirectionRef>
17 \\
18 <!~-~- A compound element uniquely identifying the trip the vehicle is serving ~-~->
19 <FramedVehicleJourneyRef>
20 \\
21 <!~-~- The GTFS service date for the trip the vehicle is serving ~-~->
22 <DataFrameRef>2011-01-28</DataFrameRef>
23 \\
24 <!~-~- The GTFS trip ID for trip the vehicle is serving, prefixed by the GTFS agency ID ~-~->
25 <DatedVehicleJourneyRef>MTA NYCT_20110102EA_087800_B63_0002_B63_19</DatedVehicleJourneyRef>
26 </FramedVehicleJourneyRef>
27 \\
28 <!~-~- The GTFS Shape_ID, prefixed by GTFS Agency ID ~-~->
29 <JourneyPatternRef>MTA NYCT_B630152</JourneyPatternRef>
30 \\
31 <!~-~- The GTFS route_short_name ~-~->
32 <PublishedLineName>B63</PublishedLineName>
33 \\
34 <!~-~- GTFS Agency_ID ~-~->
35 <OperatorRef>MTA NYCT</OperatorRef>
36 \\
37 <!~-~- The GTFS stop ID for the first stop on the trip the vehicle is serving, prefixed by Agency ID ~-~->
38 <OriginRef>MTA_801131</OriginRef>
39 \\
40 <!~-~- The GTFS stop ID for the last stop on the trip the vehicle is serving, prefixed by Agency ID ~-~->
41 <DestinationRef>MTA_801042</DestinationRef>
42 \\
43 <!~-~- The GTFS trip_headsign for the trip the vehicle is serving ~-~->
44 <DestinationName>BAY RIDGE SHORE RD via 5 AV</DestinationName>
45 \\
46 <!~-~- If a bus has not yet departed, OriginAimedDepartureTime indicates the scheduled departure time of that bus from that terminal in ISO8601 format ~-~->
47 <OriginAimedDepartureTime>2011-01-28T14:45:00.000-04:00 </OriginAimedDepartureTime>
48 \\
49 <!~-~- SituationRef, present only if there is an active service alert covering this call ~-~->
50 <SituationRef>
51 <SituationSimpleRef>MTA NYCT_8d065d76-2813-46ee-b024-20f956232831</SituationSimpleRef>
52 </SituationRef>
53 \\
54 <!~-~- Always true ~-~->
55 <Monitored>true</Monitored>
56 \\
57 <!~-~- The most recently recorded or inferred coordinates of this vehicle ~-~->
58 <VehicleLocation>
59 <Longitude>-73.97857</Longitude>
60 <Latitude>40.68448</Latitude>
61 </VehicleLocation>
62 \\
63 <!~-~- Vehicle bearing: 0 is East, increments counter-clockwise ~-~->
64 <Bearing>345.7</Bearing>
65 \\
66 <!~-~- Indicator of whether the bus is making progress (i.e. moving, generally), not moving (with value noProgress), laying over before beginning a trip (value layover), or serving a trip prior to one which will arrive (prevTrip). ~-~->
67 <ProgressRate>normalProgress</ProgressRate>
68 \\
69 <!~-~- Optional indicator of vehicle progress status. Set to "layover" when the bus is in a layover waiting for its next trip to start at a terminal, and/or "prevTrip" when the bus is currently serving the previous trip and the information presented 'wraps around' to the following scheduled trip. ~-~->
70 <ProgressStatus>layover</ProgressStatus>
71 \\
72 <!~-~- Optional indicator of whether the bus occupancy is deemed to be "full","seatsAvailable" or "standingAvailable". If bus occupancy information is not available, this indicator is not shown (aka hidden.) ~-~->
73 <Occupancy>seatsAvailable</Occupancy>
74 \\
75 <!~-~- The vehicle ID, preceded by the GTFS agency ID ~-~->
76 <VehicleRef>MTA NYCT_7582</VehicleRef>
77 \\
78 <!~-~- Depending on the system's level of confidence, the GTFS block_id the bus is serving. Please see "Transparency of Block vs. Trip-Level Assignment" section below ~-~->
79 <BlockRef>MTA NYCT_20120902CE_JG_24900_B35-26-JG_1503</BlockRef>
80 \\
81 <!~-~- Call data about a particular stop ~-~->
82 <!~-~- In StopMonitoring, it is the stop of interest; in VehicleMonitoring it is the next stop the bus will make. ~-~->
83 \\
84 <MonitoredCall>
85 \\
86 <!~-~- The GTFS stop ID of the stop prefixed by agency_id ~-~->
87 <StopPointRef>MTA_308214</StopPointRef>
88 \\
89 <!~-~- The ordinal value of the visit of this vehicle to this stop, always 1 in this implementation ~-~->
90 <VisitNumber>1</VisitNumber>
91 \\
92 <!~-~- Predicted arrival/departure times in ISO8601 format ~-~->
93 <ExpectedArrivalTime>2015-06-04T10:46:08.361-04:00</ExpectedArrivalTime>
94 <ExpectedDepartureTime>2015-06-04T10:46:08.361-04:00</ExpectedDepartureTime>
95 \\
96 <!~-~- SIRI container for extensions to the standard ~-~->
97 <Extensions>
98 \\
99 <!~-~- The MTA Bus Time extensions to show distance of the vehicle from the stop ~-~->
100 <Distances>
101 \\
102 <!~-~- The distance of the stop from the beginning of the trip/route ~-~->
103 <CallDistanceAlongRoute>3038.9</CallDistanceAlongRoute>
104 \\
105 <!~-~- The distance from the vehicle to the stop along the route, in meters ~-~->
106 <DistanceFromCall>1101.7</DistanceFromCall>
107 \\
108 <!~-~- The distance displayed in the UI, see below for an additional note ~-~->
109 <PresentableDistance>5 stops away</PresentableDistance>
110 \\
111 <!~-~- The number of stops on the vehicle's current trip until the stop in question, starting from 0 ~-~->
112 <StopsFromCall>5</StopsFromCall>
113 </Distances>
114 </Extensions>
115 \\
116 </MonitoredCall>
117 \\
118 <!~-~- The collection of calls that a vehicle is going to make. ~-~->
119 <OnwardCalls>
120 \\
121 <!~-~- A stop that the vehicle is going to make, if the detailLevel is set to calls ~-~->
122 <OnwardCall>
123 \\
124 <!~-~- The GTFS stop ID of the stop ~-~->
125 <StopPointRef>MTA_308215</StopPointRef>
126 \\
127 <!~-~- The ordinal value of the visit of this vehicle to this stop, always 1 in this implementation ~-~->
128 <VisitNumber>1</VisitNumber>
129 \\
130 <!~-~- The GTFS stop name of the stop ~-~->
131 <StopPointName>5 AV - GARFIELD PL</StopPointName>
132 \\
133 <!~-~- SIRI container for extensions to the standard ~-~->
134 <Extensions>
135 \\
136 <!~-~- The MTA Bus Time extensions to show distance of the vehicle from the stop ~-~->
137 <Distances>
138 \\
139 <!~-~- The distance of the stop from the beginning of the trip/route ~-~->
140 <CallDistanceAlongRoute>3267.1</CallDistanceAlongRoute>
141 \\
142 <!~-~- The distance from the vehicle to the stop along the route, in meters ~-~->
143 <DistanceFromCall>1329.9</DistanceFromCall>
144 \\
145 <!~-~- The distance displayed in the UI ~-~->
146 <PresentableDistance>6 stops away</PresentableDistance>
147 \\
148 <!~-~- The number of stops on the vehicle's current trip until the stop in question, starting from 0 ~-~->
149 <StopsFromCall>6</StopsFromCall>
150 </Distances>
151 </Extensions>
152 \\
153 </OnwardCall>
154 \\
155 ... more OnwardCalls
156 \\
157 </OnwardCalls>
158 </MonitoredVehicleJourney>
159
160 === The PresentableDistance field: ===
161 The logic that determines whether stops or miles are shown in the PresentableDistance field is below:
162
163 show distance in miles if and only if:
164
165 ##(distance in miles to _immediate next stop_ is > D) OR (distance in stops to current stop is > N AND distance in miles to current stop > E)
166
167 in other words, show distance in stops if and only if (the below is just the inverse of the above, according to DeMorgan's law):
168
169 ##(distance in miles to _immediate next stop_ is <= D) AND (distance in stops to current stop <= N OR distance in miles to current stop <= E)
170
171 Show "approaching" if and only if:
172
173 ##distance_in_miles to immediate next stop < P
174
175 show "at stop" if and only if:
176
177 ##distance_in_miles to immediate next stop < T
178
179 Current Parameter Values:
180
181 |=Parameter|=Value
182 |D| .5 miles
183 |N| 3 stops
184 |E| .5 miles
185 |P| 500 feet
186 |T| 100 feet
187
188 === Transparency of Block vs. Trip-Level Assignment ===
189
190 MTA Bus Time tries to assign buses to blocks- a sequence of trips that start and end at a depot. This allows the system to make a statement about what a bus will do after it reaches the end of its current trip.
191
192 However, there is not always enough affirmative and corresponding evidence to make such a strong statement. In this case, MTA Bus Time falls back to a trip-level assignment, where it just picks a trip from the schedule that is representative of the route and stopping pattern that the bus is likely to pursue.
193
194 The SIRI API now reflects this distinction as described here and in other items below. If the assignment is block-level, the new ##BlockRef## field of the ##MonitoredVehicleJourney## is present, and populated with the assigned block id.