umts / bojangles

Ruby script for monitoring the PVTA realtime bus departures feed
MIT License
0 stars 0 forks source link

Departures at the beginning of a trip occurring after a trip ending at the same key stop get thrown out #40

Closed dfaulken closed 7 years ago

dfaulken commented 7 years ago

The following two lines occur in stop_times.txt (line numbers included):

116389 2062228-UM1617-UMTS-Weekday-03,17:35:00,17:35:00,72,29,0,0
116390 2062229-UM1617-UMTS-Weekday-03,07:45:00,07:45:00,72,1,0,0

The first is a trip which ends at stop 72 (Studio Arts Building). Bojangles' logic is meant to exclude this, which we achieve by grabbing the row after every row which we think is a departure via remembering the index of the row we think is the departure. Then we iterate through the pairs of rows we grabbed and throw out pairs whose trip IDs do not match.

This is incorrect, because in cases like this it throws out a perfectly legitimate departure, causing things like https://github.com/umts/pvta-avail/issues/860.