Open pietercolpaert opened 8 years ago
FYI: computeConnections
of the gtfs-utils
package implements this in JavaScript:
The problem I have with frequencies is the semantic intention: the departureTime and arrivalTime become an interval, and the amount of resulting trips may also be a bit more or less depending on the line. I’m unsure how to translate this to connection objects that get a persistent identifier.
the amount of resulting trips may also be a bit more or less depending on the line.
I don’t understand what you mean. Doesn‘t the amount of trips only depend on the headway (and start and end time)?
I‘m rather worried about extact-times !== 1
, because the connection won‘t have a fixed time anymore, so a Linked Connections endpoint might convey a degree of certainty (time-wise) that the data/reality doesn‘t provide.
I’m unsure how to translate this to connection objects that get a persistent identifier.
Currently the id of a connection is https://github.com/linkedconnections/gtfs2lc/blob/cb0bdac0e790dc0ebea811111d9794fc13aa308c/lib/URIStrategy.js, right? Couldn‘t the id of a freqnecies-based connection be {trips.startTime(yyyyMMdd)}/{depStop}/{trips.trip_id}/{index}
? I would be really hard to resolve this ID with non-GTFS data sources though.
FYI I have updated gtfs-utils
to use plain for await
loops & async functions. This means that you can just for await
-loop over all connections (including frequencies.txt
). It's Node 12+ though.
We need to process frequencies as well...
This means reading an extra file if it exists, and adding extra connections based on the connectionRules stream