jamespfennell / transiter

Web service for transit data
https://demo.transiter.dev
MIT License
59 stars 7 forks source link

[GTFS Full Support] Add scheduled trip data to realtime trips #62

Open jamespfennell opened 4 years ago

jamespfennell commented 4 years ago

Observed on the LIRR.

The realtime spec says that trip stop times don't need to have times in them, if they can instead be matched with a scheduled trip stop time. We need to implement this realtime-static logic fully.

In all cases, we should add relevant (nullable) foreign keys to TripStopTime and ScheduledTripStopTime. The question is how much data to map from the scheduled trip to the realtime trip during the ETL process - right now the route is mapped over. Probably easiest to do it during the ETL process.

jamespfennell commented 4 years ago

We should be sensitive about the performance of this. Perhaps if doing the reconciliation is CPU intensive, it could be an option in the parser or the feed.

jamespfennell commented 4 years ago

We should add at least one foreign key here to know if a scheduled trip has been taken by a realtime trip.

jamespfennell commented 4 years ago

One catch is that ScheduledTrips are deleted manually. Will need to clear any FKs before deleting

jamespfennell commented 1 year ago

https://github.com/jamespfennell/transiter/pull/119 unblocks this because the scheduled trip data is now persisted.

In the GTFS realtime updater, we should read the schedule data and import data from the scheduled trip into the realtime trip. This is needed to get the SF BART train running I believe.