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

Add draft GTFS-TripModifications proto file #6

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
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
115 changes: 115 additions & 0 deletions gtfs-realtime/proto/gtfs-realtime.proto
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ message FeedEntity {
// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
optional Shape shape = 6;

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

// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
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
// modifications to the spec.
Expand Down Expand Up @@ -1022,3 +1028,112 @@ 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.
// NOTE: This message is still experimental, and subject to change. It may be formally adopted in the future.
message Stop {
enum LocationType {
STOP = 0;
STATION = 1;
ENTRANCE = 2;
GENERIC_NODE = 3;
BOARDING_AREA = 4;
}

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 LocationType location_type = 10 [default = STOP];
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;
}

// NOTE: This message is still experimental, and subject to change. It may be formally adopted in the future.
message TripModifications {
// NOTE: This message is still experimental, and subject to change. It may be formally adopted in the future.
message Modification {
// The first stop sequence of the original trip that is to be affected by this modification.
required 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.
required 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;
}

// NOTE: This message is still experimental, and subject to change. It may be formally adopted in the future.
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.
required 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).
required 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