AtB-AS / tavla

:bus: A customizable departure board for public transport in Trøndelag
https://tavla.dev.mittatb.no
Other
2 stars 0 forks source link

Avviksmeldinger #29

Closed rosvik closed 4 years ago

rosvik commented 4 years ago

Disruption messages from Siri-SX or GTFS-RX should be displayed on Tavla.

Messages would refer to a stop, route or agency (AtB globaly).

Siri-SX

AtB uses Siri-SX and Siri-VM (Situation Exchange and Vehicle Monitoring). SX gives data on disruptions.

From https://enturas.atlassian.net/wiki/spaces/PUBLIC/pages/637370605/SIRI-SX

  1. Situation Exchange (SX) for information on disruptions in the public transport service a. Information about planned deviations (such as maintenance work on the tracks) b. Information about unplanned deviations (such as accidents, unforeseen issues with passengers, objects blocking the road, or severe weather)

Badly formatted example: atb-data.txt

See examples at https://github.com/entur/profile-examples/tree/master/siri/situation-exchange

GTFS-RX

Formatted like Service Alerts here: http://wiki.itsfactory.fi/index.php/GTFS-RT

See EntitySelector. References would be to

Available as JSON and Protobuf (.pbf). Protobuf can be loaded in the browser https://gavinr.com/protocol-buffers-protobuf-browser/

API endpoint: https://api.entur.io/realtime/v1/gtfs-rt/trip-updates?datasource=RUT

rosvik commented 4 years ago

XML result from SIRI-SX Lite

https://api.entur.io/realtime/v1/rest/sx?requestorId=757c9284-0f12-4a46-a557-33a19e801192

XML ```xml 0001-01-01T00:00:00+00:43 ATB 803 closed 2020-06-22T11:53:00+02:00 2020-06-27T23:59:00+02:00 incident Tillerterminalen - Holdeplassen er stengt / Bus stop is closed Tillerterminalen - Holdeplassen er stengt / Bus stop is closed ``` ```xml 0001-01-01T00:00:00+00:43 ATB 804 draft 2020-06-22T17:26:00+02:00 2020-08-09T23:26:00+02:00 incident Holdeplassen Dalavegen er stengt. Holdeplassen Dalavegen er stengt. ``` ```xml 0001-01-01T00:00:00+00:43 ATB 813 published 2020-06-24T08:23:00+02:00 2020-06-27T23:59:00+02:00 stopPoint incident Holdeplassen er stengt / Bus stop is closed Holdeplassen er stengt / Bus stop is closed NSR:Quay:75607 Tillerterminalen busStop 10.3748726927514 63.3594408431041 1 NSR:Quay:75606 Tillerterminalen busStop 10.3756503211581 63.3593974432034 1 ``` ```xml 0001-01-01T00:00:00+00:43 ATB 797 draft 2020-04-27T10:26:00+02:00 2020-08-09T10:26:00+02:00 incident Linje 72 og 23 har startholdeplass her. Linje 72 og 23 har startholdeplass her. ``` ```xml 0001-01-01T00:00:00+00:43 ATB 764 closed 2020-06-04T12:00:00+02:00 2020-06-27T23:59:00+02:00 incident Tillerterminalen - Holdeplassen er stengt / Bus stop is closed Tillerterminalen - Holdeplassen er stengt / Bus stop is closed ``` ```xml 0001-01-01T00:00:00+00:43 ATB 796 draft 2020-05-11T18:24:00+02:00 2020-08-09T18:24:00+02:00 incident Tillerterminalen er midlertidig stengt - holdeplassene City Syd benyttes istedet. Se atb.no/driftsavvik. Tillerterminalen er midlertidig stengt - holdeplassene City Syd benyttes istedet. Se atb.no/driftsavvik. ``` ```xml 0001-01-01T00:00:00+00:43 ATB 763 closed 2020-06-04T12:00:00+02:00 2020-06-27T23:59:00+02:00 incident Tillerterminalen - Holdeplassen er stengt / Bus stop is closed Tillerterminalen - Holdeplassen er stengt / Bus stop is closed ``` ```xml 0001-01-01T00:00:00+00:43 ATB 760 closed 2020-06-04T12:00:00+02:00 2020-06-27T23:59:00+02:00 stopPoint incident Holdeplassen er stengt / Bus stop is closed Holdeplassen er stengt / Bus stop is closed NSR:Quay:75607 Tillerterminalen busStop 10.3748726927514 63.3594408431041 1 NSR:Quay:75606 Tillerterminalen busStop 10.3756503211581 63.3593974432034 1 ``` ```xml 0001-01-01T00:00:00+00:43 ATB 799 closed 2020-06-22T11:53:00+02:00 2020-06-27T23:59:00+02:00 stopPoint incident Holdeplassen er stengt / Bus stop is closed Holdeplassen er stengt / Bus stop is closed NSR:Quay:75607 Tillerterminalen busStop 10.3748726927514 63.3594408431041 1 NSR:Quay:75606 Tillerterminalen busStop 10.3756503211581 63.3593974432034 1 ``` ```xml 0001-01-01T00:00:00+00:43 ATB 762 closed 2020-06-04T12:00:00+02:00 2020-06-27T23:59:00+02:00 incident Tillerterminalen - Holdeplassen er stengt / Bus stop is closed Tillerterminalen - Holdeplassen er stengt / Bus stop is closed ``` ```xml 0001-01-01T00:00:00+00:43 ATB 761 closed 2020-06-04T12:00:00+02:00 2020-06-27T23:59:00+02:00 incident Tillerterminalen - Holdeplassen er stengt / Bus stop is closed Tillerterminalen - Holdeplassen er stengt / Bus stop is closed ``` ```xml 0001-01-01T00:00:00+00:43 ATB 798 published 2020-05-04T23:55:00+02:00 2020-08-09T23:55:00+02:00 stopPoint incident Omstigningsholdeplass for linjene: 1,16,23,50,71 og 72 blir holdeplassene City Syd østre og vestre. Omstigningsholdeplass for linjene: 1,16,23,50,71 og 72 blir holdeplassene City Syd østre og vestre. NSR:Quay:75611 City Syd busStop 10.3789200764688 63.3604610029231 1 NSR:Quay:75612 City Syd busStop 10.379785838377 63.3605872802577 1 NSR:Quay:72720 Martin Linges veg busStop 10.3678244408752 63.3587904688343 1 NSR:Quay:72719 Martin Linges veg busStop 10.3679626837145 63.3591751269956 1 NSR:Quay:71517 Rostengrenda busStop 10.3815925380798 63.3653183066598 1 NSR:Quay:71518 Rostengrenda busStop 10.3815945827106 63.3645283653549 1 ``` ```xml 0001-01-01T00:00:00+00:43 ATB 814 draft 2020-06-24T08:23:00+02:00 2020-06-27T23:59:00+02:00 incident Tillerterminalen - Holdeplassen er stengt / Bus stop is closed Tillerterminalen - Holdeplassen er stengt / Bus stop is closed ``` ```xml 0001-01-01T00:00:00+00:43 ATB 800 closed 2020-06-22T11:53:00+02:00 2020-06-27T23:59:00+02:00 incident Tillerterminalen - Holdeplassen er stengt / Bus stop is closed Tillerterminalen - Holdeplassen er stengt / Bus stop is closed ```
rosvik commented 4 years ago

Generating typescript Protobuf schema:

See PR 107 in https://github.com/mapbox/pbf : https://github.com/junghans-schneider/pbf

git clone junghans-schneider/pbf
cd pbf
npm install
npm run build-dev
./bin/pbf 
curl -O https://developers.google.com/transit/gtfs-realtime/gtfs-realtime.proto
./bin/pbf gtfs-realtime.proto --typescript > gtfs-realtime.ts
rosvik commented 4 years ago
#!/bin/bash

protoc -I=. gtfs-rt/gtfs-realtime.proto --grpc-web_out=import_style=typescript,mode=grpcwebtext:.
protoc -I=. sx-gtfs-rt-proxy/sx-gtfs-rt-proxy.proto --grpc-web_out=import_style=typescript,mode=grpcwebtext:.