Wiki source code of CancelledTripAPIFeatures
Last modified by admin admin on 2024/07/23 04:53
Hide last authors
author | version | line-number | content |
---|---|---|---|
1.1 | 1 | ||
2 | = SIRI API = | ||
3 | |||
4 | ==== API paths ==== | ||
5 | |||
6 | There are two available versions of the SIRI api and each of those is available with or without cancelled trip information. This table shows the API path to reach the four possible combinations: | ||
7 | |||
8 | |= |=(% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 700; text-align: start;" %)Without Cancelled Trip Information |=With Cancelled Trip Information | ||
9 | |= SIRI v1 | /api/siri/stop-monitoring.xml| /api/2/siri/stop-monitoring.xml | ||
10 | |= SIRI v2 | /api/siri/stop-monitoring.xml?version=2| /api/2/siri/stop-monitoring.xml?version=2 | ||
11 | |||
12 | |||
13 | As before, the version of SIRI is specified with a query parameter "version" and the possible values are '1' or '2'. | ||
14 | |||
15 | If cancelled trip information is not desired, you can continue to use the same path as before. | ||
16 | |||
17 | To include cancelled trip information add a '2' path parameter between /api/ and /siri/ | ||
18 | |||
19 | |||
20 | ==== Stop-monitoring output ==== | ||
21 | |||
22 | If the stop being queried has no cancelled trips, there is no change to the output. | ||
23 | |||
24 | If there are relevant cancelled trips for the stop, they will appear as a MonitoredStopVisit. | ||
25 | |||
26 | It's important to note that previously, scheduled trips without corresponding real-time data would simply not appear. But if a scheduled trip missing real time data is also marked as cancelled, it will appear in the output. | ||
27 | |||
28 | Cancelled trips which are relevant to the stop being monitored will appear as a MonitoredStopVisit. | ||
29 | |||
30 | |||
31 | For SIRI V1, if a trip is cancelled then MonitoredStopVisit>MonitoredVehicleJourney>MonitoredCall will have two properties, ArrivalStatus and DepartureStatus, both of which will show cancelled: | ||
32 | |||
33 | |||
34 | <MonitoredVehicleJourney> | ||
35 | |||
36 | <MonitoredStopVisit> | ||
37 | |||
38 | <MonitoredCall> | ||
39 | |||
40 | <ArrivalStatus>cancelled</ArrivalStatus> | ||
41 | |||
42 | <DepartureStatus>cancelled</DepartureStatus> | ||
43 | |||
44 | </MonitoredCall> | ||
45 | |||
46 | </MonitoredStopVisit> | ||
47 | |||
48 | </MonitoredVehicleJourney> | ||
49 | |||
50 | |||
51 | For SIRI V2 if a trip is cancelled then its MonitoredStopVisit>MonitoredVehicleJourney will have one property, VehicleStatus, which will show cancelled: | ||
52 | |||
53 | |||
54 | <MonitoredStopVisit> | ||
55 | |||
56 | <MonitoredVehicleJourney> | ||
57 | |||
58 | <VehicleStatus>cancelled</VehicleStatus> | ||
59 | |||
60 | </MonitoredVehicleJourney> | ||
61 | |||
62 | <MonitoredStopVisit> | ||
63 | |||
64 | |||
65 | = GTFS-RT = | ||
66 | |||
67 | |||
68 | ==== Trip Update Support ==== | ||
69 | |||
70 | The GTFS-RT component has been extended to support Trip Updates of the type ScheduleRelationship.CANCELLED: | ||
71 | |||
72 | | entity { | ||
73 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) id: "GH_A2-Weekday-SDon-056200_BX39_754"(%%) | ||
74 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) trip_update {(%%) | ||
75 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) trip {(%%) | ||
76 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) trip_id: "GH_A2-Weekday-SDon-056200_BX39_754"(%%) | ||
77 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) start_date: "20220310"(%%) | ||
78 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) schedule_relationship: CANCELED(%%) | ||
79 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) route_id: "BX39"(%%) | ||
80 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) direction_id: 0(%%) | ||
81 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) }(%%) | ||
82 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) timestamp: 1646921884575(%%) | ||
83 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) }(%%) | ||
84 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %)} | ||
85 | |||
86 | The GTFS-RT trip updates feed remains at the same location, no change is necessary to consume the new data. [[https://gtfsrt.prod.obanyc.com/tripUpdates||style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start; text-decoration-line: underline;"]] | ||
87 | |||
88 | |||
89 | ==== Alert Support ==== | ||
90 | |||
91 | The GTFS-RT component now includes a consequence effect to allow CAPI alerts to be readily differentiated from Mercury alerts. The consequence are of the type REDUCED_SERVICE as shown below:\\ | ||
92 | |||
93 | | entity { | ||
94 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) id: "MTA NYCT_GH_A2-Weekday-SDon-063200_BX39_765"(%%) | ||
95 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) alert {(%%) | ||
96 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) informed_entity {(%%) | ||
97 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) agency_id: "MTA NYCT"(%%) | ||
98 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) trip {(%%) | ||
99 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) route_id: "BX39"(%%) | ||
100 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) direction_id: 0(%%) | ||
101 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) }(%%) | ||
102 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) }(%%) | ||
103 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) informed_entity {(%%) | ||
104 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) agency_id: "MTA NYCT"(%%) | ||
105 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) trip {(%%) | ||
106 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) route_id: "BX39"(%%) | ||
107 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) direction_id: 1(%%) | ||
108 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) }(%%) | ||
109 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) }(%%) | ||
110 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) effect: REDUCED_SERVICE(%%) | ||
111 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) description_text {(%%) | ||
112 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) translation {(%%) | ||
113 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) text: "The 10:32am BX39 to SOUNDVIEW AV/CORNELL AV is canceled"(%%) | ||
114 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) language: "EN"(%%) | ||
115 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) }(%%) | ||
116 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) }(%%) | ||
117 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %) }(%%) | ||
118 | (% style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start;" %)} | ||
119 | |||
120 | The GTFS-RT alerts feed remains at the same location, no change is necessary to consume the new data. [[https://gtfsrt.prod.obanyc.com/alerts||style="font-family: sans-serif; font-size: 14px; font-style: normal; font-weight: 400; text-align: start; text-decoration-line: underline;"]] | ||
121 |