Open jamespfennell opened 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.
We should add at least one foreign key here to know if a scheduled trip has been taken by a realtime trip.
One catch is that ScheduledTrips are deleted manually. Will need to clear any FKs before deleting
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.
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.