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

GTFS Trip-Modifications #9

Closed
wants to merge 10 commits into from
Closed

GTFS Trip-Modifications #9

wants to merge 10 commits into from

Conversation

gcamp
Copy link
Member

@gcamp gcamp commented Sep 25, 2023

Following the proposal of GTFS Trip-Modifications in February, we are now ready for the pull request stage!

As a reminder, Trip-Modifications are modifications done to a trip to modify its shape, remove stops that are not served anymore, and potentially add temporary stops. Trip-Modifications is mainly used in a detour use case.

Today, we're launching the detour feature for more agencies with Trip Modifications produced by Swiftly! Now that there is one producer and one consumer, the current PR is not an experimental field and actually removes the experimental tag for Shape, which has been in the spec for 2 years.

Feel free to ask questions, or give feedback!

Example of the feature in practice:
Swiftly_Detours-screens-4 png

Copy link

@timMillet timMillet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments for clarification and consistency


## _message_ TripModifications

A `TripModifications` message identifies a list of similar `trip_ids` sharing the same stop pattern, which are all affected by a particular modification, like a detour. The modification is in effect on all of the listed service_dates, until it is removed from the feed. On any given service date, a trip MUST NOT be assigned to more than one `TripModifications` object.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"similar trip_ids from the (CSV) GTFS"


## _message_ Stop

Represent a new Stop added to the feed dynamically. All fields are as described in the GTFS-Static specification. Location type of the new stop is assumed to be `0` (routable stop).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"(CSV) GTFS" (already used in the spec) instead of "GTFS-Static" (?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, and I hate it 🤷

| _**Field Name**_ | _**Type**_ | _**Required**_ | _**Cardinality**_ | _**Description**_ |
|------------------|------------|----------------|-------------------|-------------------|
| **modifications_id** | [string](https://developers.google.com/protocol-buffers/docs/proto#scalar) | Required | One | An arbitrary string to identify this detour. The `modifications_id` MUST be unique for all currently active detours. The ID of each replacement trip is generated by concatenating `modifications_id` + ‘_’ + `trip_id`. |
| **trip_ids** | [string](https://developers.google.com/protocol-buffers/docs/proto#scalar) | Required | Many | A list of trips affected by this detour. All trips linked by those trip_ids MUST have the same stop pattern. Two trips have the same stop pattern, if they visit the same stops in the same order, and have identical stop sequences. If the value `start_times` is set, a maximum of one trip_id can be listed. |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"A list of trips from (CSV) GTFS affected by this detour"


| _**Field Name**_ | _**Type**_ | _**Required**_ | _**Cardinality**_ | _**Description**_ |
|------------------|------------|----------------|-------------------|-------------------|
| **start_stop_sequence** | [uint32](https://developers.google.com/protocol-buffers/docs/proto#scalar) | Required | One | The first stop sequence of the original trip that is to be affected by this modification. |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The stop sequence value from the (CSV) GTFS of the first stop sequence affected by this modification"

| _**Field Name**_ | _**Type**_ | _**Required**_ | _**Cardinality**_ | _**Description**_ |
|------------------|------------|----------------|-------------------|-------------------|
| **start_stop_sequence** | [uint32](https://developers.google.com/protocol-buffers/docs/proto#scalar) | Required | One | The first stop sequence of the original trip that is to be affected by this modification. |
| **num_stops_replaced** | [uint32](https://developers.google.com/protocol-buffers/docs/proto#scalar) | Required | One | The number of stops which are canceled and replaced by the `new_stops`. May be zero to indicate no skipped stops. |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"The number of stops (i.e. the number of stop_time rows from the (CSV) GTFS) which are ..."

gtfs-realtime/spec/en/reference.md Outdated Show resolved Hide resolved
@npaun npaun changed the title Add Trip-Modification, make shape non-experimental Add Trip-Modifications, make shape non-experimental Sep 25, 2023
@gcamp gcamp changed the title Add Trip-Modifications, make shape non-experimental GTFS Trip-Modifications Sep 25, 2023
@gcamp gcamp force-pushed the trip_modifications branch from 003a838 to 3654bbf Compare September 25, 2023 20:35
thbar and others added 8 commits September 25, 2023 16:49
* Forbid subfolders in GTFS files

See google#377

* Update gtfs/spec/en/reference.md

Co-authored-by: Leonard Ehrenfried <[email protected]>

* Simplify wording based on feedback

---------

Co-authored-by: Leonard Ehrenfried <[email protected]>
* Added timeframes

* Add date-based fares

* Update timeframes.txt description

* Change end time from required to optional

* Records with the same timeframe id must cover a 24h period

* no overlap

* remove requirement on 24h coverage and overlapping

* fix typo

* Revert changes in timeframes.end_time

* move service_id to timeframes.txt

* Move timeframes to the fares v2 section

* rename timeframe_id to timeframe_group_id

* place timeframes.txt with other Fares v2 files

* Rename from/to fields + change empty semantics

- Rename from_timeframe_id and to_timeframe_id to start_timeframe_group_id and to_timeframe_group_id
- Change empty semantics so that an empty entry means the fare isn't affected (as opposed to the "empty means everything except")

* add line break

* Add timeframes description

* Make timeframe fields required

* service_id references calendar or calendar_dates

* Add requirements

- the whole day must be covered with timeframes if one is defined
- there should not be overlapping time frames with the same timeframe_group_id and service_id

* typo

* Update timeframe fields description

* end time is not included in the interval

* Add timeframe_type field

* Overlapping time frames must not be defined

for the same timeframe_group_id and service_id

* introduce override

Introduce an override field in fare_leg_rules and remove the requirement of needing the whole day covered with timeframes if one is defined.

* improve override description

* Revert "improve override description"

This reverts commit d4afc6e.

* improve override description

* update timeframe fields description

changes "a row" to "one row"

* remove timeframe fields for no exact matched found

* Update descriptions for empty values:

- removed the "If there are no matching `fare_leg_rules.start_timeframe_group_id` values to the
`timeframe_group_id` being filtered..."
- added "that rule will match a particular leg if either start_timeframe_group_id is empty, or if there exists at least a row in `timeframes.txt` where all..."

* Both values need to be empty or neither should be empty

as discussed in the last working group meeting

* Change to local time semantics

As discussed in the working group meeting

* Changed name start/end_timeframe_group_id

As discussed in working group meeting

* Remove timeframe_type & priority fields

Changes as discussed in working group meeting

* revise "start" to "end"

* Remove "initial" after Gavriel's comment

Gavriel pointed out in the proposal document that "initial" is un-necessary https://docs.google.com/document/d/1N3WpgAh2OxPuE5Vvjbd6mjvKK42M7mSVdxscVvzP8SU/edit

* Remove unnecessary empty description

* Changes based on Jeremy's feedback

Comment google#357 (comment)

1. Specify "time of day" of fare leg's start/end time
2. Clarify the start_time/end_time are in timeframes.txt

Additional: change "row" to " "record" to synchronize the rest of GTFS.

* Modify empty wording

Based on Hal's suggestion - google#357 (comment)

* Move overlapping requirement out of service_id description

---------

Co-authored-by: omar-kabbani <[email protected]>
Co-authored-by: Tzu-Jen Chan <[email protected]>
…pe's maximum distance (google#380)

* Indicate max `shape_dist_traveled` for stop times

Added rule specifying that the `shape_dist_traveled` for a stop time must not exceed the total (maximum) distance for the shape of the given trip.

* Added trip reference

Clarified the shape for the related trip

* Minor update for Google CLA

Minor update to create commit with non-private email address.
* Add recommended presence

* feed_info.txt best practices

* route_short_name best practice

* agency_id best practice

* timepoint best practice

* inlining image for shape_dist_traveled

* shape_dist_traveled field best practices

* block_id field presence best practice

* Clearer recommended definition

* clarity improvements

* Remove "may" for block_id in frequency based trips

* fix shape_dist_traveled cell formatting
* arri/dept time updates

Clarify implied timezone for time values at stop_times.arrival_time & stop_times.departure_time

* Removed "local time"

Removed "local time" from Field Type: Time

* Remove "for the day on which the trip schedule begins"

comment from derhuerst - google#378 (comment)

* Add "not stops.stop_timezone"

Add "not stops.stop_timezone" for both departure_time and arrival_time
Added fare_media_type=1 in description
* Update revision history

* Add merged PRs

* small update
First, the spec maintainers are not as Swiss-centric as they used to be
be.

Second, there is only one Swiss national holiday. The rest are
canton-specific, so the spec was not clear anyway.

Ref: https://groups.google.com/g/gtfs-changes/c/cUIt61d95-Y/m/rBTcndx_AgAJ
@gcamp gcamp force-pushed the trip_modifications branch from fb686c2 to 004f046 Compare September 25, 2023 20:49
Fix typo

Add images

Update image width

Add newlines

Add newlines

Update images

Italic for image description

Update SLO

travel_time_to_stop is optional

Proto : all feild optional

Add references to GTFS-Static
@gcamp gcamp force-pushed the trip_modifications branch from 004f046 to bd16afc Compare September 26, 2023 00:41
@gcamp gcamp closed this Sep 26, 2023
@gcamp gcamp deleted the trip_modifications branch January 23, 2024 20:55
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

Successfully merging this pull request may close these issues.

8 participants