Version 1.2 by admin admin on 2024/07/23 04:18

Hide last authors
admin admin 1.2 1 = SIRI MonitoredVehicleJourney Element =
admin admin 1.1 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
admin admin 1.2 9
10 ##<MonitoredVehicleJourney>
11 \\\\ <!~-~- The 'fully qualified' route name (GTFS agency ID + route ID) for the trip the vehicle is serving. Not intended to be customer-facing. ~-~->
admin admin 1.1 12 <LineRef>MTA NYCT_B63</LineRef>
admin admin 1.2 13 \\\\ <!~-~- The GTFS direction for the trip the vehicle is serving ~-~->
admin admin 1.1 14 <DirectionRef>1</DirectionRef>
admin admin 1.2 15 \\\\ <!~-~- A compound element uniquely identifying the trip the vehicle is serving ~-~->
admin admin 1.1 16 <FramedVehicleJourneyRef>
admin admin 1.2 17 \\\\ <!~-~- The GTFS service date for the trip the vehicle is serving ~-~->
admin admin 1.1 18 <DataFrameRef>2011-01-28</DataFrameRef>
admin admin 1.2 19 \\\\ <!~-~- The GTFS trip ID for trip the vehicle is serving, prefixed by the GTFS agency ID ~-~->
admin admin 1.1 20 <DatedVehicleJourneyRef>MTA NYCT_20110102EA_087800_B63_0002_B63_19</DatedVehicleJourneyRef>
21 </FramedVehicleJourneyRef>
admin admin 1.2 22 \\\\ <!~-~- The GTFS Shape_ID, prefixed by GTFS Agency ID ~-~->
admin admin 1.1 23 <JourneyPatternRef>MTA NYCT_B630152</JourneyPatternRef>
admin admin 1.2 24 \\\\ <!~-~- The GTFS route_short_name ~-~->
admin admin 1.1 25 <PublishedLineName>B63</PublishedLineName>
admin admin 1.2 26 \\\\ <!~-~- GTFS Agency_ID ~-~->
admin admin 1.1 27 <OperatorRef>MTA NYCT</OperatorRef>
admin admin 1.2 28 \\\\ <!~-~- The GTFS stop ID for the first stop on the trip the vehicle is serving, prefixed by Agency ID ~-~->
admin admin 1.1 29 <OriginRef>MTA_801131</OriginRef>
admin admin 1.2 30 \\\\ <!~-~- The GTFS stop ID for the last stop on the trip the vehicle is serving, prefixed by Agency ID ~-~->
admin admin 1.1 31 <DestinationRef>MTA_801042</DestinationRef>
admin admin 1.2 32 \\\\ <!~-~- The GTFS trip_headsign for the trip the vehicle is serving ~-~->
admin admin 1.1 33 <DestinationName>BAY RIDGE SHORE RD via 5 AV</DestinationName>
admin admin 1.2 34 \\\\ <!~-~- If a bus has not yet departed, OriginAimedDepartureTime indicates the scheduled departure time of that bus from that terminal in ISO8601 format ~-~->
admin admin 1.1 35 <OriginAimedDepartureTime>2011-01-28T14:45:00.000-04:00 </OriginAimedDepartureTime>
admin admin 1.2 36 \\\\ <!~-~- SituationRef, present only if there is an active service alert covering this call ~-~->
admin admin 1.1 37 <SituationRef>
38 <SituationSimpleRef>MTA NYCT_8d065d76-2813-46ee-b024-20f956232831</SituationSimpleRef>
39 </SituationRef>
admin admin 1.2 40 \\\\ <!~-~- Always true ~-~->
admin admin 1.1 41 <Monitored>true</Monitored>
admin admin 1.2 42 \\\\ <!~-~- The most recently recorded or inferred coordinates of this vehicle ~-~->
admin admin 1.1 43 <VehicleLocation>
44 <Longitude>-73.97857</Longitude>
45 <Latitude>40.68448</Latitude>
46 </VehicleLocation>
admin admin 1.2 47 \\\\ <!~-~- Vehicle bearing: 0 is East, increments counter-clockwise ~-~->
admin admin 1.1 48 <Bearing>345.7</Bearing>
admin admin 1.2 49 \\\\ <!~-~- 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). ~-~->
admin admin 1.1 50 <ProgressRate>normalProgress</ProgressRate>
admin admin 1.2 51 \\\\ <!~-~- 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. ~-~->
admin admin 1.1 52 <ProgressStatus>layover</ProgressStatus>
admin admin 1.2 53 \\\\ <!~-~- 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.) ~-~->
admin admin 1.1 54 <Occupancy>seatsAvailable</Occupancy>
admin admin 1.2 55 \\\\ <!~-~- The vehicle ID, preceded by the GTFS agency ID ~-~->
admin admin 1.1 56 <VehicleRef>MTA NYCT_7582</VehicleRef>
admin admin 1.2 57 \\\\ <!~-~- 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 ~-~->
admin admin 1.1 58 <BlockRef>MTA NYCT_20120902CE_JG_24900_B35-26-JG_1503</BlockRef>
admin admin 1.2 59 \\\\ <!~-~- Call data about a particular stop ~-~->
admin admin 1.1 60 <!~-~- In StopMonitoring, it is the stop of interest; in VehicleMonitoring it is the next stop the bus will make. ~-~->
admin admin 1.2 61 \\\\ <MonitoredCall>
62 \\\\ <!~-~- The GTFS stop ID of the stop prefixed by agency_id ~-~->
admin admin 1.1 63 <StopPointRef>MTA_308214</StopPointRef>
admin admin 1.2 64 \\\\ <!~-~- The ordinal value of the visit of this vehicle to this stop, always 1 in this implementation ~-~->
admin admin 1.1 65 <VisitNumber>1</VisitNumber>
admin admin 1.2 66 \\\\ <!~-~- Predicted arrival/departure times in ISO8601 format ~-~->
admin admin 1.1 67 <ExpectedArrivalTime>2015-06-04T10:46:08.361-04:00</ExpectedArrivalTime>
68 <ExpectedDepartureTime>2015-06-04T10:46:08.361-04:00</ExpectedDepartureTime>
admin admin 1.2 69 \\\\ <!~-~- SIRI container for extensions to the standard ~-~->
admin admin 1.1 70 <Extensions>
admin admin 1.2 71 \\\\ <!~-~- The MTA Bus Time extensions to show distance of the vehicle from the stop ~-~->
admin admin 1.1 72 <Distances>
admin admin 1.2 73 \\\\ <!~-~- The distance of the stop from the beginning of the trip/route ~-~->
admin admin 1.1 74 <CallDistanceAlongRoute>3038.9</CallDistanceAlongRoute>
admin admin 1.2 75 \\\\ <!~-~- The distance from the vehicle to the stop along the route, in meters ~-~->
admin admin 1.1 76 <DistanceFromCall>1101.7</DistanceFromCall>
admin admin 1.2 77 \\\\ <!~-~- The distance displayed in the UI, see below for an additional note ~-~->
admin admin 1.1 78 <PresentableDistance>5 stops away</PresentableDistance>
admin admin 1.2 79 \\\\ <!~-~- The number of stops on the vehicle's current trip until the stop in question, starting from 0 ~-~->
admin admin 1.1 80 <StopsFromCall>5</StopsFromCall>
81 </Distances>
82 </Extensions>
admin admin 1.2 83 \\\\ </MonitoredCall>
84 \\\\ <!~-~- The collection of calls that a vehicle is going to make. ~-~->
admin admin 1.1 85 <OnwardCalls>
admin admin 1.2 86 \\\\ <!~-~- A stop that the vehicle is going to make, if the detailLevel is set to calls ~-~->
admin admin 1.1 87 <OnwardCall>
admin admin 1.2 88 \\\\ <!~-~- The GTFS stop ID of the stop ~-~->
admin admin 1.1 89 <StopPointRef>MTA_308215</StopPointRef>
admin admin 1.2 90 \\\\ <!~-~- The ordinal value of the visit of this vehicle to this stop, always 1 in this implementation ~-~->
admin admin 1.1 91 <VisitNumber>1</VisitNumber>
admin admin 1.2 92 \\\\ <!~-~- The GTFS stop name of the stop ~-~->
admin admin 1.1 93 <StopPointName>5 AV - GARFIELD PL</StopPointName>
admin admin 1.2 94 \\\\ <!~-~- SIRI container for extensions to the standard ~-~->
admin admin 1.1 95 <Extensions>
admin admin 1.2 96 \\\\ <!~-~- The MTA Bus Time extensions to show distance of the vehicle from the stop ~-~->
admin admin 1.1 97 <Distances>
admin admin 1.2 98 \\\\ <!~-~- The distance of the stop from the beginning of the trip/route ~-~->
admin admin 1.1 99 <CallDistanceAlongRoute>3267.1</CallDistanceAlongRoute>
admin admin 1.2 100 \\\\ <!~-~- The distance from the vehicle to the stop along the route, in meters ~-~->
admin admin 1.1 101 <DistanceFromCall>1329.9</DistanceFromCall>
admin admin 1.2 102 \\\\ <!~-~- The distance displayed in the UI ~-~->
admin admin 1.1 103 <PresentableDistance>6 stops away</PresentableDistance>
admin admin 1.2 104 \\\\ <!~-~- The number of stops on the vehicle's current trip until the stop in question, starting from 0 ~-~->
admin admin 1.1 105 <StopsFromCall>6</StopsFromCall>
106 </Distances>
107 </Extensions>
admin admin 1.2 108 \\\\ </OnwardCall>
109 \\\\ ... more OnwardCalls
110 \\\\ </OnwardCalls>
111 </MonitoredVehicleJourney>##
admin admin 1.1 112
113 === The PresentableDistance field: ===
admin admin 1.2 114
admin admin 1.1 115 The logic that determines whether stops or miles are shown in the PresentableDistance field is below:
116
117 show distance in miles if and only if:
118
admin admin 1.2 119 ##(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)##
admin admin 1.1 120
121 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):
122
admin admin 1.2 123 ##(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)##
admin admin 1.1 124
125 Show "approaching" if and only if:
126
admin admin 1.2 127 ##distance_in_miles to immediate next stop < P##
admin admin 1.1 128
129 show "at stop" if and only if:
130
admin admin 1.2 131 ##distance_in_miles to immediate next stop < T##
admin admin 1.1 132
133 Current Parameter Values:
134
admin admin 1.2 135 |=Parameter|=Value   
admin admin 1.1 136 |D| .5 miles
137 |N| 3 stops
138 |E| .5 miles
139 |P| 500 feet
140 |T| 100 feet
141
142 === Transparency of Block vs. Trip-Level Assignment ===
143
admin admin 1.2 144 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. 
admin admin 1.1 145
146 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.
147
148 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.