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

Deprecate TripUpdate.schedule_relationship = ADDED, add TripUpdate.schedule_relationship = NEW / REPLACEMENT to specify new / replaced trips which do not run on a schedule from the GTFS static. #504

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
dc181de
specify ADDED and REPLACEMENT schedule relationships, and add more fi…
miklcct Sep 25, 2024
b439cf8
remove the recommendation that ADDED is not specified
miklcct Sep 25, 2024
5a9853f
disallow TripModification on trips with TripUpdate.schedule_relations…
miklcct Sep 25, 2024
21ccde5
revert formatting
miklcct Sep 26, 2024
b6d07cc
specify that route_id is required for added trips
miklcct Sep 26, 2024
6bc14c8
Clarify the use of StopTimeUpdate to specify the whole journey in add…
miklcct Sep 26, 2024
87d28c7
Clarify the time and delay for added and replacement trips
miklcct Sep 26, 2024
991caac
Update gtfs-realtime/spec/en/reference.md
miklcct Sep 30, 2024
fea9f81
Update gtfs-realtime/spec/en/reference.md
miklcct Sep 30, 2024
b6faa23
restore formatting
miklcct Oct 2, 2024
0e62760
add scheduled time
miklcct Oct 8, 2024
896129e
allow scheduled time for duplicated trip as well
miklcct Oct 8, 2024
43a9b00
fix wording
miklcct Oct 8, 2024
e22668e
Merge remote-tracking branch 'upstream/master' into added-replacement
miklcct Dec 3, 2024
3ff34bf
remove fields that I am not going to use
miklcct Dec 3, 2024
573124c
Update gtfs-realtime/spec/en/reference.md
miklcct Dec 3, 2024
ade68ae
Update gtfs-realtime/spec/en/reference.md
miklcct Dec 3, 2024
2f019d8
remove reference to timepoint for scheduled time as it is removed fro…
miklcct Dec 3, 2024
555a619
Merge commit 'ade68aecf431db49d3bcbc55dcb43090dfd0b0dc' into added-re…
miklcct Dec 3, 2024
a2a0dd8
apply review feedback
miklcct Jan 16, 2025
aa90291
mark new fields as experimental
miklcct Jan 16, 2025
4361f12
use NEW instead of ADDED for a new trip
miklcct Jan 21, 2025
d0843d5
add migration guide
miklcct Jan 21, 2025
7804def
add some best practices
miklcct Jan 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions gtfs-realtime/best-practices/best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ If separate `VehiclePosition` and `TripUpdate` feeds are provided, [TripDescript

For example, a `VehiclePosition` entity has `vehicle_id:A` and `trip_id:4`, then the corresponding `TripUpdate` entity should also have `vehicle_id:A` and `trip_id:4`.

| Field Name | Recommendation |
| --- | --- |
| `schedule_relationship` | The behavior of `ADDED` trips are unspecified and the use of this enumeration is not recommended. |

### VehicleDescriptor

If separate `VehiclePosition` and `TripUpdate` feeds are provided, [TripDescriptor](#TripDescriptor) and [VehicleDescriptor](#VehicleDescriptor) ID values pairing should match between the two feeds.
Expand Down
67 changes: 55 additions & 12 deletions gtfs-realtime/proto/gtfs-realtime.proto
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,28 @@ message TripUpdate {
// (e.g., `VehiclePosition.stop_id`).
// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
optional string assigned_stop_id = 1;

// The updated headsign of the vehicle at the stop.
optional string stop_headsign = 2;

// The updated pickup of the vehicle at the stop.
optional DropOffPickupType pickup_type = 3;

// The updated drop off of the vehicle at the stop.
optional DropOffPickupType drop_off_type = 4;
miklcct marked this conversation as resolved.
Show resolved Hide resolved

// The updated timing point status of the vehicle at the stop.
// If false, the vehicle will no longer wait at the stop;
// if true, the vehicle will wait until the scheduled time at the stop.
optional bool timepoint = 5;

// Identifies the boarding booking rule at this stop time.
// Refers to a `booking_rule_id` defined in the GTFS `booking_rules.txt`.
optional string pickup_booking_rule_id = 6;
miklcct marked this conversation as resolved.
Show resolved Hide resolved

// Identifies the alighting booking rule at this stop time.
// Refers to a `booking_rule_id` defined in the GTFS `booking_rules.txt`.
optional string drop_off_booking_rule_id = 7;

// The extensions namespace allows 3rd-party developers to extend the
// GTFS Realtime Specification in order to add and evaluate new features
Expand All @@ -279,6 +301,20 @@ message TripUpdate {

// The following extension IDs are reserved for private use by any organization.
extensions 9000 to 9999;

enum DropOffPickupType {
// Regularly scheduled pickup/dropoff.
REGULAR = 0;

// No pickup/dropoff available
NONE = 1;

// Must phone agency to arrange pickup/dropoff.
PHONE_AGENCY = 2;

// Must coordinate with driver to arrange pickup/dropoff.
COORDINATE_WITH_DRIVER = 3;
}
miklcct marked this conversation as resolved.
Show resolved Hide resolved
}

// Realtime updates for certain properties defined within GTFS stop_times.txt
Expand Down Expand Up @@ -378,6 +414,18 @@ message TripUpdate {
// be marked as schedule_relationship=SKIPPED.
// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
optional string shape_id = 4;

// Specifies the headsign for this trip when it differs from the original.
// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
optional string trip_headsign = 5;

// Specifies the name for this trip when it differs from the original.
// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
optional string trip_short_name = 6;

// Specifies the block for this trip when it differs from the original.
// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
optional string block_id = 7;
miklcct marked this conversation as resolved.
Show resolved Hide resolved

// The extensions namespace allows 3rd-party developers to extend the
// GTFS Realtime Specification in order to add and evaluate new features
Expand Down Expand Up @@ -793,13 +841,7 @@ message TripDescriptor {
// enough to the scheduled trip to be associated with it.
SCHEDULED = 0;

// An extra trip that was added in addition to a running schedule, for
// example, to replace a broken vehicle or to respond to sudden passenger
// load.
// NOTE: Currently, behavior is unspecified for feeds that use this mode. There are discussions on the GTFS GitHub
// [(1)](https://github.com/google/transit/issues/106) [(2)](https://github.com/google/transit/pull/221)
// [(3)](https://github.com/google/transit/pull/219) around fully specifying or deprecating ADDED trips and the
// documentation will be updated when those discussions are finalized.
// An extra trip unrelated to any existing trips, for example, to respond to sudden passenger load.
ADDED = 1;

// A trip that is running with no schedule associated to it (GTFS frequencies.txt exact_times=0).
Expand All @@ -809,17 +851,18 @@ message TripDescriptor {
// A trip that existed in the schedule but was removed.
CANCELED = 3;

// Should not be used - for backwards-compatibility only.
REPLACEMENT = 5 [deprecated=true];
// A trip that replaces an existing trip in the schedule.
REPLACEMENT = 5;
miklcct marked this conversation as resolved.
Show resolved Hide resolved
miklcct marked this conversation as resolved.
Show resolved Hide resolved

// An extra trip that was added in addition to a running schedule, for example, to replace a broken vehicle or to
// respond to sudden passenger load. Used with TripUpdate.TripProperties.trip_id, TripUpdate.TripProperties.start_date,
// and TripUpdate.TripProperties.start_time to copy an existing trip from static GTFS but start at a different service
// date and/or time. Duplicating a trip is allowed if the service related to the original trip in (CSV) GTFS
// (in calendar.txt or calendar_dates.txt) is operating within the next 30 days. The trip to be duplicated is
// identified via TripUpdate.TripDescriptor.trip_id. This enumeration does not modify the existing trip referenced by
// TripUpdate.TripDescriptor.trip_id - if a producer wants to cancel the original trip, it must publish a separate
// TripUpdate with the value of CANCELED or DELETED. Trips defined in GTFS frequencies.txt with exact_times that is
// TripUpdate.TripDescriptor.trip_id - if a producer wants to replace the original trip, a value of `REPLACEMENT` should be used instead.
//
// Trips defined in GTFS frequencies.txt with exact_times that is
// empty or equal to 0 cannot be duplicated. The VehiclePosition.TripDescriptor.trip_id for the new trip must contain
// the matching value from TripUpdate.TripProperties.trip_id and VehiclePosition.TripDescriptor.ScheduleRelationship
// must also be set to DUPLICATED.
Expand Down Expand Up @@ -1117,7 +1160,7 @@ message TripModifications {
}

message SelectedTrips {
// A list of trips affected with this replacement that all have the same new `shape_id`.
// A list of trips affected with this replacement that all have the same new `shape_id`. A `TripUpdate` with `schedule_relationship=REPLACEMENT` must not already exist for the trip.
repeated string trip_ids = 1;
// The ID of the new shape for the modified trips in this SelectedTrips.
// May refer to a new shape added using a GTFS-RT Shape message, or to an existing shape defined in the GTFS-Static feed’s shapes.txt.
Expand Down
Loading