Skip to content

Commit

Permalink
Add Trip-Modification, make shape non-experimental
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gcamp committed Sep 25, 2023
1 parent 0936339 commit 004f046
Show file tree
Hide file tree
Showing 5 changed files with 202 additions and 8 deletions.
103 changes: 98 additions & 5 deletions gtfs-realtime/proto/gtfs-realtime.proto
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ message FeedEntity {
optional TripUpdate trip_update = 3;
optional VehiclePosition vehicle = 4;
optional Alert alert = 5;

// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
optional Shape shape = 6;
optional Stop stop = 7;
optional TripModifications trip_modifications = 8;

// The extensions namespace allows 3rd-party developers to extend the
// GTFS Realtime Specification in order to add and evaluate new features and
Expand Down Expand Up @@ -1010,19 +1010,16 @@ message TranslatedImage {
// Tracing the points in order provides the path of the vehicle. Shapes do not need to intercept
// the location of Stops exactly, but all Stops on a trip should lie within a small distance of
// the shape for that trip, i.e. close to straight line segments connecting the shape points
// NOTE: This message is still experimental, and subject to change. It may be formally adopted in the future.
message Shape {
// Identifier of the shape. Must be different than any shape_id defined in the (CSV) GTFS.
// This field is required as per reference.md, but needs to be specified here optional because "Required is Forever"
// See https://developers.google.com/protocol-buffers/docs/proto#specifying_field_rules
// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
optional string shape_id = 1;

// Encoded polyline representation of the shape. This polyline must contain at least two points.
// For more information about encoded polylines, see https://developers.google.com/maps/documentation/utilities/polylinealgorithm
// This field is required as per reference.md, but needs to be specified here optional because "Required is Forever"
// See https://developers.google.com/protocol-buffers/docs/proto#specifying_field_rules
// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
optional string encoded_polyline = 2;

// The extensions namespace allows 3rd-party developers to extend the
Expand All @@ -1033,3 +1030,99 @@ message Shape {
// The following extension IDs are reserved for private use by any organization.
extensions 9000 to 9999;
}

// Describes a stop which is served by trips. All fields are as described in the GTFS-Static specification.
message Stop {
enum WheelchairBoarding {
UNKNOWN = 0;
AVAILABLE = 1;
NOT_AVAILABLE = 2;
}

required string stop_id = 1;
optional TranslatedString stop_code = 2;
optional TranslatedString stop_name = 3;
optional TranslatedString tts_stop_name = 4;
optional TranslatedString stop_desc = 5;
optional float stop_lat = 6;
optional float stop_lon = 7;
optional string zone_id = 8;
optional TranslatedString stop_url = 9;
optional string parent_station = 11;
optional string stop_timezone = 12;
optional WheelchairBoarding wheelchair_boarding = 13 [default = UNKNOWN];
optional string level_id = 14;
optional TranslatedString platform_code = 15;

// The extensions namespace allows 3rd-party developers to extend the
// GTFS Realtime Specification in order to add and evaluate new features and
// modifications to the spec.
extensions 1000 to 1999;

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

message TripModifications {
message Modification {
// The first stop sequence of the original trip that is to be affected by this modification.
optional uint32 start_stop_sequence = 1;

// The number of stops which are canceled and replaced by the new_stops. May be zero to indicate no skipped stops.
optional uint32 num_stops_replaced = 2;

// The number of seconds of delay to add to all departure and arrival times following the end of this modification. If multiple modifications apply to the same trip, the delays accumulate as the trip advances.
optional int32 propagated_modification_delay = 3 [default = 0];

// A list of replacement stops, replacing those of the original trip. The length of the new stop times may be less, the same, or greater than the number of replaced stop times.
repeated ReplacementStop new_stops = 4;

// The extensions namespace allows 3rd-party developers to extend the
// GTFS Realtime Specification in order to add and evaluate new features and
// modifications to the spec.
extensions 1000 to 1999;

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

// 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.
required string modifications_id = 1;

// 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.
repeated string trip_ids = 2;

// Dates on which the detour occurs, in the YYYYMMDD format. Producers SHOULD only transmit detours occurring within the next week.
repeated string service_dates = 3;

// The ID of the new shape for the modified trips. 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.
optional string shape_id = 4;

// A list of modifications to apply to the affected trips.
repeated Modification modifications = 5;

// The extensions namespace allows 3rd-party developers to extend the
// GTFS Realtime Specification in order to add and evaluate new features and
// modifications to the spec.
extensions 1000 to 1999;

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

message ReplacementStop {
// The difference in seconds between the arrival time at this stop and the arrival time at the reference stop. The reference stop is the stop prior to start_stop_sequence. If the modification begins at the first stop of the trip, then the first stop of the trip is the reference stop.
// This value MUST be monotonically increasing and may only be a negative number if the first stop of the original trip is the reference stop.
optional int32 travel_time_to_stop = 1;

// The replacement stop ID which will now be visited by the trip. May refer to a new stop added using a GTFS-RT Stop message, or to an existing stop defined in the GTFS-Static feed’s stops.txt. The stop MUST have location_type=0 (routable stops).
optional string stop_id = 2;

// The extensions namespace allows 3rd-party developers to extend the
// GTFS Realtime Specification in order to add and evaluate new features and
// modifications to the spec.
extensions 1000 to 1999;

// The following extension IDs are reserved for private use by any organization.
extensions 9000 to 9999;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added gtfs-realtime/spec/en/images/propagated_delay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 004f046

Please sign in to comment.