Add safe duration fields to trips.txt to provide better flexible trip time estimates #598
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This proposal adds the ability to define the travel duration of flexible ("on-demand") services, relative to direct driving durations that consumers are expected to estimate themselves.
Describe the Problem
Currently, consumers can only use driving duration to display trip time estimates for flexible services. Because driving duration is based on algorithms for private vehicles and not public transit, these estimates can be quite different from reality. This also makes it more difficult for consumers to display service availability accurately to users, as the travel time used to calculate whether the queried trip falls within a given service's hours of operation may not match reality.
Use Cases
Allows consumers to include a safe travel time estimate (i.e., the longest expected time the trip could take for 95% of cases) for trips of vehicles that inevitably behave differently than a private car, taking into account such factors as:
Proposed Solution
This proposal adds two new fields to trips.txt:
safe_duration_factorandsafe_duration_offset. Producers can use these two fields to add a trip time multiplier, fixed offset value (in seconds), or both to a given flexible trip. Consumers can then take these values to offer a safe travel duration to riders. For example, if a consumer's routing algorithm calculates that the driving time of a given flexible trip will take 30 minutes and that trip has asafe_duration_factorof1.5and asafe_duration_offsetof60, the consumer can use the safe duration fields to display an adjusted travel time estimate of 46 minutes (30 minutes * 1.5 + 1 minute).Type of change
GTFS Schedule
Additional Information
This extension was originally part of the GTFS-FlexibleTrips proposal in early 2024 but was left out of the adopted base implementation because the feature was not ready.
Proposed Discussion Period
Preliminary discussion of this feature took place here, here, and here. I recommend reserving at least two weeks for discussion to ensure the wider GTFS community has sufficient time to offer feedback.
Testing Details
The feature in its current form has already been in testing for almost one year. I recommend testing any changes made to this proposal.
Proposal Update Tracker
Checklist