-
Notifications
You must be signed in to change notification settings - Fork 184
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
Add cars_allowed field to trips.txt #466
Comments
@VillePihlava Thanks for bringing this up here! This is pretty relatable. When travelling in the Greek islands, some ferries allowed for cars and others didn't. Would have been great to have GTFS information on this. Also, thank you for posting your first issue on google/transit! Your contributions are always appreciated! 🚀 |
Another thing that has to be considered related to this is whether a stop has the accommodations for loading cars. The stops.txt GTFS file (https://gtfs.org/schedule/reference/#stopstxt) contains the |
Support for this information will be implemented in OpenTripPlanner and Fintraffic will produce the data (at least for the ferries in Finland and maybe for trains as well). We have discussed this addition and potential ways it can be modeled in GTFS with some fellow OTP developers. First alternative we came up with consists of:
In this alternative, it would be possible to first add support for only the 1. (and maybe 2.) and later on expand the spec to support for modeling the edge cases. However, if a consumer has only added support for 1., there might be potential issues if 2. and 3. are added later on. Second alternative:Create a new file which is meant for modelling where cars are allowed or even something more generic that is not limited to cars as in the future, we might want to model, for example, if scooters are allowed in vehicles. The benefit from this approach would be that only a small percentage of trips/stops allow car boarding and the addition of the new fields in existing files would increase the file sizes just to model these few cases where it's possible to board/alight with a car. The downside of this approach would be that it's slightly unusual compared to how most things in GTFS are currently modeled. |
The same improvement should also be applied to bike and wheelchair as well |
Should we also consider the need to book in advance vs ad hoc boarding with cars? This could be tackled with more enum values. However, this same problem is currently unsolved for bikes and wheelchairs. |
Shall we then deprecate the current
I think a new table is needed to properly encode all of the above. I hope I can add support to my journey planner for taking bikes onto the tube / train but it is impossible to encode the rules in the current GTFS spec. |
I think the proposal of adding a new file/table mentioned by @optionsome and @miklcct would be a good idea. Designing the proposal for the new file requires some work though. I can look more into this in ~1 month if this issue hasn't progressed in other directions by then. |
I'm not aware of GTFS having two ways of specifying the same thing or using a deprecation strategy so I think you will have to convince the community that it's worth doing it. |
Based on the comment of @leonardehrenfried maybe the original approach would instead be better. If there is no deprecation strategy, maybe adding a new field with enough enum values would work? |
There are existing file formats that allow specifying this at the level of stop_times.txt, hence from sequence_n to sequence_m you are allowed to do something. The something is an attribute which is defined in another file. |
@skinkie can you give/link to the file formats you are referencing? I would be interested in looking at them |
@VillePihlava HAFAS TEXT (Hacon/Siemens Mobility) is the format that generally everyone would reference to as the format having the best in attribute descriptions. https://opentransportdata.swiss/en/cookbook/hafas-rohdaten-format-hrdf/ Within NeTEx the concept of describing that some part of a trip defined by a start end end stop is a JourneyPart, it can also be used as a restriction on facilities, it that case it would be a RestrictedServiceFacilitySetRef, again allowing a From/To. Especially for cars it is important that boarding and alighting (pickup/dropoff) is well specified. |
In the case of trains: It is also possible that you can't board without having a bicycle, motorcycle or car/truck. E.g. BLS Kandersteg-Lötschberg. So it is not only allowed, but mandated as well. |
Maybe the https://gtfs.org/schedule/process/#changes-to-the-spec-should-be-backwards-compatible:
|
In addition to @skinkie Transmodel/NeTEx would see this partially also as ACCESS MODE. an ACCESS MODE is defined on a SITE (stop_times is not a bad choice there. definition: PERSONAL MODE used to access or leave the public transport system (e.g., by foot, by private bicycle, by private car). |
There is a lot of good discussion in this issue now, for example, going forward with the However, as I have not previously contributed to the GTFS standard, the question on deprecation and having two ways of specifying the same thing is an open question for me at least (see the comment from @leonardehrenfried). Before drafting a more thorough proposal it would be nice to know how to deal with a situation like this. I can think of at least three ways:
What would be the best approach? I'm not sure who to direct this question towards. @eliasmbd would you know about this? |
@VillePihlava I can provide some points from governance perspective:
|
Thanks for the answers! I'll start working on a more thorough proposal that roughly follows the 2. of the ways I mentioned |
After thinking about this I came up with this approach: SummaryThe solution would be to add one field to The information referenced in Non-complete list of requirements based on the discussion in this issue
Additions to
|
Field Name | Type | Presence | Description |
---|---|---|---|
cars_allowed |
Enum | Optional | Indicates whether cars are allowed. Valid options are:0 or empty - No car information for the trip.1 - Vehicle being used on this particular trip can accommodate at least one car.2 - No cars are allowed on this trip. |
New file boarding_permissions.txt
Field Name | Type | Presence | Description |
---|---|---|---|
boarding_permission_id |
Unique ID | Required | Identifies a boarding_permission. |
car_mode |
Enum | Optional | Indicates in which way cars can be taken on board. Valid options should be discussed in detail in another issue. |
bike_mode |
Enum | Optional | Indicates in which way bikes can be taken on board. Valid options should be discussed in detail in another issue. |
wheelchair_mode |
Enum | Optional | Indicates in which way wheelchairs can be taken on board. Valid options should be discussed in detail in another issue. |
Additions to stop_times.txt
Field Name | Type | Presence | Description |
---|---|---|---|
boarding_permission_id |
Foreign ID referencing boarding_permissions.boarding_permission_id |
Optional | Identifies a boarding_permission. |
Non-complete list of possible issues/things that need to be considered
- Should boarding permissions be different for boarding and alighting?
- What enum values are possible for accomodating all possibilities? For example, I can think of these modes for bikes:
- No bike information
- Vehicle can accommodate at least one bicycle
- No bicycles allowed
- Bicycles mandatory
- Vehicle can accommodate bicycle but requires reservation
- Bicycles mandatory and requires reservation
- How should different types of things/vehicles be separated? In this comment I separate
car_mode
,bike_mode
andwheelchair_mode
. However, should motorcycles and scooters also have enum values? Should they instead be separate? Can they be considered as cars? - Should more fields be added to
trips.txt
for motorcycles and scooters, for example? - Should more enum values be added to, for example,
bikes_allowed
in thetrips.txt
file for accommodating all possible cases? I think changes to existing enum values are usually not done though, although I could be wrong.
@miklcct you listed a lot of things that you wanted to see changed. What do you think of the approach I wrote down in the previous comment? |
The The vehicle is an enum which can be a bike, wheelchair, car, motorcycle, etc. Carriage permission means if the vehicle can remain on board after departing the stop specified. For frequency-based trips, a start time and end time can also be specified. Entries with start and end time override entries without. For example, a London Underground Jubilee line frequency-based service in regard of bike carriage can be specified as Similarly, an SWR peak train listed in blue in the timetable can be specified as To denote that bikes can be carried through intermediate stations but not boarding / alighting there |
I like the suggestions by @miklcct. The vehicle enum is a much better choice than having enums for each vehicle. I modeled the modified approach in this comment. I think the What do you think of this @miklcct? Do you want to create the new issue for discussing this or should I? At least at the moment, the additions to If splitting the issue ( Additions to
|
Field Name | Type | Presence | Description |
---|---|---|---|
cars_allowed |
Enum | Optional | Indicates whether cars are allowed. Valid options are:0 or empty - No car information for the trip.1 - Vehicle being used on this particular trip can accommodate at least one car.2 - No cars are allowed on this trip. |
New file boarding_permissions.txt
Field Name | Type | Presence | Description |
---|---|---|---|
boarding_permission_id |
Unique ID | Required | Identifies a boarding_permission. |
vehicle |
Enum | Required | Identifies a vehicle. 0 - Bike. 1 - Car. 2 - Wheelchair. 3 - Motorcycle. |
pickup_permission |
Enum | Optional | Indicates whether pick up is possible for the specified vehicle. 0 or empty - false. 1 - true. |
drop_off_permission |
Enum | Optional | Indicates whether drop off is possible for the specified vehicle. 0 or empty - false. 1 - true. |
carriage_permission |
Enum | Optional | Indicates whether the vehicle can remain on board after departing the specified stop. 0 or empty - false. 1 - true. |
reservation_required |
Enum | Optional | Indicates whether a reservation is required. 0 or empty - false. 1 - true. |
vehicle_mandatory |
Enum | Optional | Indicates whether a vehicle is required on board. 0 or empty - false. 1 - true. |
start_time |
Time | Conditionally Required | Only used with frequency-based trips. Defines the beginning of a timeframe for when this permission is valid. Required if end_time is defined, forbidden otherwise. |
end_time |
Time | Conditionally Required | Only used with frequency-based trips. Defines the end of a timeframe for when this permission is valid. Required if start_time is defined, forbidden otherwise. |
Additions to stop_times.txt
Field Name | Type | Presence | Description |
---|---|---|---|
boarding_permission_id |
Foreign ID referencing boarding_permissions.boarding_permission_id |
Optional | Identifies a boarding_permission. |
@VillePihlava Thanks for reaching out and I am glad you are at the point of publishing your PR! Now:Quoting the Process, I would focus on points 1 -3 first:
Next steps:
|
I would say that reservation required should not be a separate field pick up permission, drop off permission, and carriage permission should have a enum value for reservation required. For example, For example, if a wheelchair can be carried on the tube, but prior booking is needed to get on at certain stations, the carriage permission will be 1 and the pick up permission will be 2. In contrast, if a bike reservation is required for part of the trip, but you don't need to inform staff to open the bike storage, carriage permission will be 2 and pick up permission will be 1. |
Also I need clarification of If both a bike and a car are listed as mandatory, is carrying any of a bike or a car enough to use the service? In this case, should we disallow the spec to have different values at the same service stop? |
Those are good points. @miklcct how do you feel about splitting the issue in the way I mentioned in my previous comment.
|
I don't think adding We can just add |
There was discussion about deprecation in this thread. The conclusion was that essentially deprecation wasn't done in GTFS. However, having 2 ways of specifying things was fine. Because of this, I think the The |
@VillePihlava Correct this is what the guiding principles say about backward compatibility:
|
So leave the existing fields alone. If we open a precedent of adding |
So would you want to go for a standardised attribute based format, where attributes can be assigned to (parts of) trips? |
In addition to |
This is a fallacy. Reasoning @miklcct made sense. |
OK, so my recommendation is to
So here is what I would like the proposal of @VillePihlava to be Changes to
|
Field Name | Type | Presence | Description |
---|---|---|---|
bikes_allowed |
Enum | Forbidden if boarding_permission_id is defined for any stop time of the trip, optional otherwise |
no change |
wheelchair_accessible |
Enum | Forbidden if boarding_permission_id is defined for any stop time of the trip, optional otherwise |
no change |
New file boarding_permissions.txt
Field Name | Type | Presence | Description |
---|---|---|---|
boarding_permission_id |
Unique ID | Required | Identifies a boarding_permission. |
vehicle |
Enum | Required | Identifies a vehicle. 0 - Bike. 1 - Car. 2 - Wheelchair. 3 - Motorcycle. |
pickup_permission |
Enum | Optional | Indicates whether pick up is possible for the specified vehicle. 0 or empty - false. 1 - true. |
drop_off_permission |
Enum | Optional | Indicates whether drop off is possible for the specified vehicle. 0 or empty - false. 1 - true. |
carriage_permission |
Enum | Optional | Indicates whether the vehicle can remain on board after departing the specified stop. 0 or empty - false. 1 - true. |
start_time |
Time | Conditionally Required | Only used with frequency-based trips. Defines the beginning of a timeframe for when this permission is valid. Required if end_time is defined, forbidden otherwise. |
end_time |
Time | Conditionally Required | Only used with frequency-based trips. Defines the end of a timeframe for when this permission is valid. Required if start_time is defined, forbidden otherwise. |
Additions to stop_times.txt
Field Name | Type | Presence | Description |
---|---|---|---|
boarding_permission_id |
Foreign ID referencing boarding_permissions.boarding_permission_id |
Optional Identifies a boarding_permission. |
At least at the moment, for this requirement I would at some point be able to find a consumer/producer for the
Because the direction in this issue seems to be with not adding this I will not be pushing for the changes. The changes to |
Having access to this feature in GTFS (and OTP) would be great for Washington State in the US, where we have a state-operated ferry system. While the simplicity and utility of adding @VillePihlava @leonardehrenfried would it be reasonable to alter the OTP implementation to use |
OTP will implement whatever is decided in the spec process. Having to change the implementation is the cost of using an experimental feature. In other words: If the gtfs community thinks that boarding_permission is the way to go, OTP will follow suit. |
As concluded in this thread, the If you decide to implement these changes, I suggest you also create an issue for this in OTP. |
Having said that, it would be nice to have a shorthand version of saying that cars are allowed to board and alight at every stop of the trip. Basically an equivalent way of saying cars_allowed=true. I think that this is a very common use case which justifies a bit of special handling. |
Also, in some cases having information for vehicle boarding related to stops alone can be useful (as opposed to stop times). For example, if real time information for trips with vehicle transportation capabilities is provided, stops that are not accessible by car in the graph in OTP can not be used for these trips without adding info to the stops (car linking is only done for stops that need it). This use case might not come up often, but if this issue is active once again, this could be considered as well. |
Further to the above comments, I can think that the addition of In For example, a ferry which requires you to take a bike, a motorcycle or a car (i.e. no foot passengers) can have all stop times set as no pick up and no drop off, but overridden in |
I looked into it further and WSDOT's ferries do operate with boarding restrictions that change within trips, and not merely because certain stations are only equipped for certain riders. There are routes where vehicles are allowed on the vessel, but are excluded from certain landings on certain trips. So, we'd need the boarding_restrictions.txt file referenced in stop_times.txt (in line with @miklcct 's approach) in order to fully represent our service. One small twist that I'm not sure we need to/should account for: there are also certain departures where vehicle reservations are necessary, even though generally they are not, and other departures where vehicle space is known to be very limited but is first-come first-served. These subtleties wouldn't be conveyed by the proposed format. The user need is I think similar to 'booking_rules.txt' -> 'message'. It seems from the conversation above that there's consensus among the group on this thread that @miklcct 's proposal works, but no producer has yet identified themselves as needing the granularity provided by that proposal vs adding cars_allowed. I can't commit my organization to publishing the data but I can raise the question and make the argument for why we should. I will move forward doing so unless someone suggests I shouldn't in the next day or two. |
The ferry spec based on GTFS, published by Japan's Ministry of Land, Infrastructure, Transport, and Tourism (MLIT) in 2022, include similar fields ( https://www.mlit.go.jp/maritime/content/001477477.pdf @iniad-bessho - ODPT might be interested in this discussion? |
My proposal has the ability to add booking_rule_id in the new file. I plan to start a PR some time around next month based on my current workload and aim to start producing data by the time Silvertown Tunnel opens (7 April). The first set of data I'll produce will contain bike restrictions on National Rail trains and London Underground / DLR. |
Describe the problem
Ferries can have the possibility to have cars on board. For these ferries a field indicating whether cars are allowed would be useful.
In addition to car ferries, this can also apply to, for example, trains that can transport cars in a similar way.
Use cases
For example:
Proposed solution
The trips.txt GTFS file (https://gtfs.org/schedule/reference/#tripstxt) contains the field
bikes_allowed
which specifies whether bikes are allowed on board. For car ferries a similar field indicating whether cars are allowed should be added, for example:
cars_allowed
- Enum - OptionalIndicates whether cars are allowed. Valid options are:
0
or empty - No car information for the trip.1
- Vehicle being used on this particular trip can accommodate at least one car.2
- No cars are allowed on this trip.Additional information
No response
The text was updated successfully, but these errors were encountered: