A new version of GTFS/TRIAS was put into production together with the OJP.
Reactions/feedback/questions
The following Trello project is for queries and comments.
https://trello.com/b/jiIZwszF/open-journey-planner
Invitations otherwise via opendata@sbb.ch
GTFS – RT
There is a new GTFS that must be used for the GTFS-RT. The dataset is entitled GTFS2020: https://opentransportdata.swiss/en/dataset/timetable-2020-gtfs2020
The GTFS data is uploaded to the FTP server once a week every Wednesday at 9.10 a.m. and is then available.
The value of the route_id’s and the trip_id’s for the same line/trip has changed compared to the old versions because we have adapted the data modelling in the new OJP DIVA system. Because the stop_id’s come from DIDOK, they are of course identical in both systems (ODP1.0 and ODP2.0/OJP).
API: https://api.opentransportdata.swiss/gtfsrt2020
Test-Key: 57c5dbbbf1fe4d000100001842c323fa9ff44fbba0b9b925f0c052d1
What has changed:
- Stops that are no longer used are now transmitted in TripUpdate with “scheduled_relationship”: “skipped”
- The values for route_id and trip_id have changed because the data is modelled differently.
- route_type 907 is no longer available in the new GTFS standard. The 907s are mapped to 1300.
- In the new GTFS, only the type is specified in route_desc. This corresponds to V.580. We will now change this to the submode so that it contains similar information as before. The route_type is also adjusted. (KNOWN ISSUE, should be resolved by mid-October).
- Pseudo-stops (stops such as the Lötschberg base tunnel) are included in Static and RT. Unfortunately with the wrong type at the moment. (KNOWN ISSUE). As a workaround, these stops should always be filtered out (id<1000).
GTFS-RT can also be obtained as JSON. However, this is intended more for testing and not for productive operation.
- https://api.opentransportdata.swiss/gtfsrt2020/ supplies the data in binary protobuf format. This is to be used by productive applications.
- https://api.opentransportdata.swiss/gtfsrt2020/?FORMAT=json delivers the data in JSON. This is only to be used to visualise the data and for test purposes (e.g. for data analyses), not by productive applications. (FORMAT is case-sensitive).
TRIAS
The new (TRIAS2020) interface is documented on the following pages:
LocationInformationRequest has been added with TRIAS2020.
New API: https://api.opentransportdata.swiss/trias2020
Test-Key: 57c5dbbbf1fe4d000100001842c323fa9ff44fbba0b9b925f0c052d1
What has changed:
- LocationInformationRequest/Response is now available
- TripRequest/Response now also displays connections that require a change of train. This means that there are several legs in one trip. There are also more types of legs.
- The schema locations must be specified in the header.
- The TRIAS elements are now transmitted with the namespace prefix “trias:” and “siri:”. If a library is used for parsing, this should continue to work without any problems.
- The line names have changed.
Example TripRequest
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 |
<?xml version="1.0" encoding="UTF-8"?> <Trias version="1.1" xmlns="http://www.vdv.de/trias" xmlns:siri="http://www.siri.org.uk/siri" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vdv.de/trias ../trias-xsd-v1.1/Trias.xsd"> <ServiceRequest> <siri:RequestTimestamp>2020-04-24T12:00:00Z</siri:RequestTimestamp> <siri:RequestorRef>IRMA</siri:RequestorRef> <RequestPayload> <TripRequest> <Origin> <LocationRef> <StopPlaceRef>8530813</StopPlaceRef> <LocationName> <Text>Zürich Kreuzplatz</Text> </LocationName> </LocationRef> <DepArrTime>2020-04-24T12:00:00Z</DepArrTime> </Origin> <Destination> <LocationRef> <StopPlaceRef>8503003</StopPlaceRef> <LocationName> <Text>Zürich Stadelhofen</Text> </LocationName> </LocationRef> </Destination> <Params> <NumberOfResults>10</NumberOfResults> <IncludeIntermediateStops>true</IncludeIntermediateStops> </Params> </TripRequest> </RequestPayload> </ServiceRequest> </Trias> |
Example TripRequest 2
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 |
<?xml version="1.0" encoding="UTF-8"?> <Trias version="1.1" xmlns="http://www.vdv.de/trias" xmlns:siri="http://www.siri.org.uk/siri" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vdv.de/trias ../trias-xsd-v1.1/Trias.xsd"> <ServiceRequest> <siri:RequestTimestamp>2020-04-24T12:00:00Z</siri:RequestTimestamp> <siri:RequestorRef>IRMA</siri:RequestorRef> <RequestPayload> <TripRequest> <Origin> <LocationRef> <GeoPosition> <Longitude>8.484003</Longitude> <Latitude>47.386135</Latitude> </GeoPosition> <LocationName> <Text>Altstetten</Text> </LocationName> </LocationRef> <DepArrTime>2020-04-24T12:00:00Z</DepArrTime> <IndividualTransportOptions> <Mode>walk</Mode> <MaxDistance>10000</MaxDistance> <MaxDuration>PT2H</MaxDuration> <MinDistance>1</MinDistance> <MinDuration>PT1S</MinDuration> <Speed>1000</Speed> </IndividualTransportOptions> </Origin> <Destination> <LocationRef> <GeoPosition> <Longitude>8.560054</Longitude> <Latitude>47.364618</Latitude> </GeoPosition> <LocationName> <Text>Hirslanden</Text> </LocationName> </LocationRef> <IndividualTransportOptions> <Mode>walk</Mode> <MaxDistance>10000</MaxDistance> <MaxDuration>PT2H</MaxDuration> <MinDistance>1</MinDistance> <MinDuration>PT1S</MinDuration> <Speed>1000</Speed> </IndividualTransportOptions> </Destination> <Via> <ViaPoint> <LocalityRef>23026230:17</LocalityRef> <LocationName> <Text>Winterthur</Text> </LocationName> </ViaPoint> </Via> <Params> <PtModeFilter> <Exclude>false</Exclude> <PtMode>tram</PtMode> <PtMode>bus</PtMode> <TramSubmode>cityTram</TramSubmode> <BusSubmode>regionalBus</BusSubmode> </PtModeFilter> <LineFilter> <Line> <LineRef>ojp:92080::R</LineRef> </Line> <Line> <LineRef>ojp:91012:B:H</LineRef> </Line> <Exclude>false</Exclude> </LineFilter> <OperatorFilter> <Exclude>false</Exclude> <OperatorRef>ojp:849:VerkehrsbetriebeZrich</OperatorRef> <OperatorRef>ojp:11:SchweizerischeBundesbahnenSBB</OperatorRef> </OperatorFilter> <WalkSpeed>150</WalkSpeed> <NumberOfResults>20</NumberOfResults> <IgnoreRealtimeData>true</IgnoreRealtimeData> <ImmediateTripStart>true</ImmediateTripStart> <InterchangeLimit>1</InterchangeLimit> <AlgorithmType>fastest</AlgorithmType> <!-- <AlgorithmType>fastest</AlgorithmType> <AlgorithmType>leastCost</AlgorithmType> <AlgorithmType>leastWalking</AlgorithmType> <AlgorithmType>minChanges</AlgorithmType>--> <ItModesToCover>walk</ItModesToCover> <IncludeTrackSections>true</IncludeTrackSections> <IncludeLegProjection>true</IncludeLegProjection> <IncludeTurnDescription>true</IncludeTurnDescription> <IncludeIntermediateStops>true</IncludeIntermediateStops> </Params> </TripRequest> </RequestPayload> </ServiceRequest> </Trias> |
Example StopEventRequest
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 |
<?xml version="1.0" encoding="UTF-8"?> <Trias version="1.1" xmlns="http://www.vdv.de/trias" xmlns:siri="http://www.siri.org.uk/siri" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vdv.de/trias ../trias-xsd-v1.1/Trias.xsd"> <ServiceRequest> <siri:RequestTimestamp>2020-04-24T12:00:00Z</siri:RequestTimestamp> <siri:RequestorRef>IRMA</siri:RequestorRef> <siri:MessageIdentifier>4711</siri:MessageIdentifier> <RequestPayload> <StopEventRequest> <Location> <LocationRef> <StopPlaceRef>8530813</StopPlaceRef> <LocationName> <Text>Zürich Kreuzplatz</Text> </LocationName> </LocationRef> <DepArrTime>2020-04-24T12:00:00Z</DepArrTime> </Location> <Params> <NumberOfResults>20</NumberOfResults> <StopEventType>both</StopEventType> <IncludeRealtimeData>true</IncludeRealtimeData> </Params> </StopEventRequest> </RequestPayload> </ServiceRequest> </Trias> |
Example TripInformationRequest
Attention: The JourneyRef must be searched for via a StopEventRequest or a TripRequest. The JourneyRef can change with every data import of a timetable. This will only change with the introduction of the Swiss Journey ID.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<?xml version="1.0" encoding="utf-8"?> <Trias version="1.1" xmlns="http://www.vdv.de/trias" xmlns:siri="http://www.siri.org.uk/siri" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.vdv.de/trias ../trias-xsd-v1.1/Trias.xsd"> <ServiceRequest> <siri:RequestTimestamp>2020-04-24T12:00:00Z</siri:RequestTimestamp> <siri:RequestorRef>IRMA</siri:RequestorRef> <siri:MessageIdentifier>4711</siri:MessageIdentifier> <RequestPayload> <TripInfoRequest> <JourneyRef>ojp:91009:B:H:j20:18975:18975</JourneyRef> <OperatingDayRef>2020-04-24</OperatingDayRef> <Params> <IncludeCalls>true</IncludeCalls> <IncludeService>true</IncludeService> </Params> </TripInfoRequest> </RequestPayload> </ServiceRequest> </Trias> |
API-Explorer (TRIAS2020)