Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defining a deviated route #75

Open
jwoyame opened this issue Jul 31, 2023 · 3 comments
Open

Defining a deviated route #75

jwoyame opened this issue Jul 31, 2023 · 3 comments

Comments

@jwoyame
Copy link

jwoyame commented Jul 31, 2023

The specification refers to route deviation as follows:

Route deviation services: the vehicle serves a fixed route and ordered set of stops, and may detour to pick up or drop off a passenger between stops.

It is currently not clear how such a route would be defined. For instance, would stop_times.txt be set up with a single trip that alternates between point stops and a common area zone? Or would the area be at the beginning of the stop sequence with a time span the covers the entire route?

I played around with these scenarios in OTP2 and could not get anything to follow the sequence while allowing for deviation. It would be great to create a sample to be hosted in this repository alongside the existing samples (which I could create with some guidance).

@westontrillium
Copy link
Contributor

This is the current consensus on how a typical route deviation service looks in a single stop_times.txt trip.

trip_id arrival_time departure_time start_pickup_drop_off_window end_pickup_drop_off_window stop_id stop_sequence pickup_type drop_off_type
trip1 10:00 10:00 -- -- stop1 1 0 0
trip1 -- -- 10:00 10:10 devationarea_from_stop1_to_stop_2 2 2 1
trip1 -- -- 10:00 10:10 devationarea_from_stop1_to_stop_2 3 1 2
trip1 10:10 10:10 -- -- stop2 4 0 0
trip1 -- -- 10:10 10:22 devationarea_from_stop2_to_stop_3 5 2 1
trip1 -- -- 10:10 10:22 devationarea_from_stop2_to_stop_3 6 1 2
trip1 10:22 10:22 -- -- stop3 7 0 0
trip1 -- -- 10:22 10:49 devationarea_from_stop3_to_stop_4 8 2 1
trip1 -- -- 10:22 10:49 devationarea_from_stop3_to_stop_4 9 1 2
trip1 10:49 10:49 -- -- stop4 10 0 0

@jwoyame
Copy link
Author

jwoyame commented Jul 31, 2023

Thank you for confirming that, Weston.

One of my attempts was:

trip_id,stop_sequence,stop_id,arrival_time,departure_time,stop_headsign,pickup_type,drop_off_type,continuous_pickup,continuous_drop_off,shape_dist_traveled,timepoint,start_pickup_drop_off_window,end_pickup_drop_off_window,pickup_booking_rule_id,drop_off_booking_rule_id
1,0,1,12:30:00,12:30:00,Fixed Stop 1,,,1,1,0,1,,,,
1,1,flexarea,,,Deviation,2,1,1,1,,,12:30:00,12:45:00,,
1,2,flexarea,,,Deviation,1,2,1,1,,,12:30:00,12:45:00,,
1,3,2,12:45:00,12:45:00,Fixed Stop 2,,,1,1,9563.648972147617,1,,,,
1,4,3,13:00:00,13:00:00,Fixed Stop 3,,,1,1,15517.191158546599,1,,,,
1,5,4,13:15:00,13:15:00,Fixed Stop 4,,,1,1,25636.93707457991,1,,,,

Where 1, 2, 3, 4 are normal stops and flexarea is defined in locations.geojson to cover a region containing all the stops. This results in using the flexarea to travel all the way to the destination, even though it is outside the time and the area (near the last stop). The same occurs when placing the area around only the second stop. So the problem appears to be OTP2 support rather than a misapplication of the spec.

@eliasmbd
Copy link
Contributor

eliasmbd commented Aug 1, 2023

🙏 Thanks for the suggestion of adding a data example for deviated route, we plan to create a page to show flex data example on gtfs.org, and will include at least 1 deviated route example, after flex is officially adopted.

📨 Also, I invite you to participate in the following PR #388 GTFS-Flex. I believe that your input would be valuable and you would remain up to date on the upcoming official adoption of Flex extension into the spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants