You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
planned stops: a list of all planned stops in the trip, from gtfs_stop_times (stop_code & shape dist ratio)
known locations: a list of know positions from siri_arrivals - route_offset & timestamp
For each stop in planned stops, find the last know location before it, and first known location after it. If the previous know location was at time t1 and offset x1, and the next known location is at time t2 and offset x2, and the stop offset is xs, then
The goal of this task is to build a table with at least the following fields:
Write a script that outputs that to a CSV (no need to write to DB at this point). The script should go under /siri .
How to do this
Assuming
You should be able to do something like:
For each trip_id in siri_arrivals, build:
For each stop in planned stops, find the last know location before it, and first known location after it. If the previous know location was at time t1 and offset x1, and the next known location is at time t2 and offset x2, and the stop offset is xs, then
ts = (xs - x1) / (x2 - x1) * (t2 - t1)
What do I need to know
The text was updated successfully, but these errors were encountered: