Is the current solution for Route Deviation provided by Flex sufficient? #499
Labels
Change: Addition
New function proposed to the specification.
Extension: GTFS-Flex
Issues and Pull Requests that focus on GTFS-Flex Extension
GTFS Schedule
Issues and Pull Requests that focus on GTFS Schedule
Status: Discussion
Issues and Pull Requests that are currently being discussed and reviewed by the community.
Support: Needs Feedback
Describe the problem
My experience so far with complete producer-consumer Flex implementations has been that route deviation is exponentially more complex than any other use case. The current approach is to explicitly define polygons representing each pickup/drop-off zone between every stop-to-stop segment in a trip and then explicitly define their pickup/drop-off windows based on the timepoints they are sandwiched by. This is a very heavyweight approach due to the amount of data processing required both by the producer and consumer. One specific example is how it creates many geographical overlaps in small spaces which poses challenges for querying actual deviation trips. The problem increases the denser the stops/shape areas are. Implementing on the producer side is equally burdensome, especially when we consider the fact that route deviation is a modification of existing fixed routes and should lend itself well to a lighter-weight extension. Currently, if a producer without data automation tools wants to implement route deviation, they would need to draw polygons for each of those stop-to-stop segments, which would require at least a working knowledge of GIS (even the shortcuts are predicated on being proficient enough in GIS to know what those shortcuts are). That producer would also need to manually enter in each start/end pickup/drop-off window based on the surrounding stops (it's also unclear what should happen for cases for stops without arrival/departure times).
Use cases
Fixed routes that can deviate within a pre-defined boundary off the regular path of travel to pick up or drop off riders upon request.
Proposed solution
At first one might assume that adding a component specific to route deviation would not be backwards compatible with the Flex components already introduced into the spec. In reality, nothing in the current spec would actually contradict additional parameters specific to route deviation, because route deviation is currently handled by applying "route category agnostic" components of Flex to model the use case (i.e., there is nothing specific to route deviation in the spec).
One solution I've thought of would be one that does not utilize locations.geojson or the time windows at all but rather adds "metadata" fields to stop_times.txt. This is actually similar to how route deviation was handled in the original Flex specification but with slightly different rules, especially in light of the already-existing Flex components in the spec.
stop_times.txt (extended)
departure_time
and before the following stop'sarrival_time
. The trip must specify ashape_id
for this field to be defined.Forbidden if this is the last stop of the trip. Optional otherwise.
departure_time
and before the following stop'sarrival_time
. The trip must specify ashape_id
for this field to be defined.Forbidden if this is the last stop of the trip. Optional otherwise.
0
or empty - No deviated pickup available. Forbidden ifpickup_deviation_radius
is defined.1
- Must phone agency to arrange a deviated pickup. Required ifpickup_deviation_radius
is defined.0
or empty - No deviated drop-off available. Forbidden ifdrop_off_deviation_radius
is defined.1
- Must phone agency to arrange a deviated drop-off.2
- Must coordinate with driver to arrange a deviated drop-off.Value of
1
or2
is required ifdrop_off_deviation_radius
is defined. Optional otherwise.This covers the vast majority of route deviation services in the United States operate based off of a fixed radial value ("3/4 of a mile off the fixed route" for example), and even ones in which that radial value fluctuates stop-to-stop. This would not cover unique deviation situations like where the deviation zone is actually a custom area not tied to the shape, however those could still be covered by the agnostic Flex components currently being used to model route deviation.
This is definitely just a draft idea and needs to be further refined, but I think it could be a good start for rethinking how we do trip planning around route deviation long term.
As a completely unqualified thought experiment, I've worked out the kind of logic possibly needed to return a route deviation trip itinerary for a pickup using the above framework.
For pickup:
Additional information
I would like to hear from consumers on whether such a solution would make it easier to provide better route deviation trip plans. If not, it would be equally valuable to hear other ideas. :)
The text was updated successfully, but these errors were encountered: