Skip to content

Commit

Permalink
use NEW instead of ADDED for a new trip
Browse files Browse the repository at this point in the history
  • Loading branch information
miklcct committed Jan 21, 2025
1 parent aa90291 commit da8039f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 22 deletions.
4 changes: 4 additions & 0 deletions gtfs-realtime/best-practices/best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ 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
12 changes: 9 additions & 3 deletions gtfs-realtime/proto/gtfs-realtime.proto
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ message TripUpdate {
// To specify a completely certain prediction, set its uncertainty to 0.
optional int32 uncertainty = 3;

// Scheduled time for an added or replacement trip.
// Scheduled time for a new or replacement trip.
// In Unix time (i.e., number of seconds since January 1st 1970 00:00:00
// UTC).
optional int64 scheduled_time = 4;
Expand Down Expand Up @@ -832,8 +832,10 @@ message TripDescriptor {
// enough to the scheduled trip to be associated with it.
SCHEDULED = 0;

// An extra trip unrelated to any existing trips, for example, to respond to sudden passenger load.
ADDED = 1;
// This value has been deprecated as the behavior was unspecified.
// Use DUPLICATED for an extra trip that is the same as a scheduled trip except the start date or time,
// or NEW for an extra trip that is unrelated to an existing trip.
ADDED = 1 [deprecated = true];

// A trip that is running with no schedule associated to it (GTFS frequencies.txt exact_times=0).
// Trips with ScheduleRelationship=UNSCHEDULED must also set all StopTimeUpdates.ScheduleRelationship=UNSCHEDULED.
Expand Down Expand Up @@ -873,6 +875,10 @@ message TripDescriptor {
// real-time predictions.
// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
DELETED = 7;

// An extra trip unrelated to any existing trips, for example, to respond to sudden passenger load.
// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
NEW = 8;
}
optional ScheduleRelationship schedule_relationship = 4;

Expand Down
Loading

0 comments on commit da8039f

Please sign in to comment.