From 878a94be7b5e1e087814cee891ca6507caf48eb5 Mon Sep 17 00:00:00 2001 From: Nicholas Paun Date: Wed, 15 Feb 2023 13:57:01 -0800 Subject: [PATCH 1/4] Add draft GTFS-TripModifications proto file --- gtfs-realtime/proto/gtfs-realtime.proto | 115 ++++++++++++++++++++++++ 1 file changed, 115 insertions(+) diff --git a/gtfs-realtime/proto/gtfs-realtime.proto b/gtfs-realtime/proto/gtfs-realtime.proto index 8ee20f0e..65872b7d 100644 --- a/gtfs-realtime/proto/gtfs-realtime.proto +++ b/gtfs-realtime/proto/gtfs-realtime.proto @@ -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. @@ -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 uint32 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; +} From 2713c6e28e3eba3e54c9b05081fb1fb21e4fe97b Mon Sep 17 00:00:00 2001 From: Nicholas Paun Date: Mon, 27 Feb 2023 12:33:15 -0800 Subject: [PATCH 2/4] Make service_dates a string for consistency with trip_descriptor --- gtfs-realtime/proto/gtfs-realtime.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs-realtime/proto/gtfs-realtime.proto b/gtfs-realtime/proto/gtfs-realtime.proto index 65872b7d..06c04481 100644 --- a/gtfs-realtime/proto/gtfs-realtime.proto +++ b/gtfs-realtime/proto/gtfs-realtime.proto @@ -1103,7 +1103,7 @@ message TripModifications { 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 uint32 service_dates = 3; + 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; From ff3bb84e7bfe4c8a0a84ee8aeed3c84fd71244db Mon Sep 17 00:00:00 2001 From: Nicholas Paun Date: Thu, 9 Mar 2023 13:59:15 -0800 Subject: [PATCH 3/4] Indicate that travel_time_to_stop is now optional --- gtfs-realtime/proto/gtfs-realtime.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs-realtime/proto/gtfs-realtime.proto b/gtfs-realtime/proto/gtfs-realtime.proto index 06c04481..6d7de21a 100644 --- a/gtfs-realtime/proto/gtfs-realtime.proto +++ b/gtfs-realtime/proto/gtfs-realtime.proto @@ -1124,7 +1124,7 @@ message TripModifications { 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; + optional int32 travel_time_to_stop = 1 [default = 0]; // 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; From d2393b43ecba397c861a426d8aefc49cd1c3a91c Mon Sep 17 00:00:00 2001 From: Nicholas Paun Date: Mon, 25 Sep 2023 10:20:38 -0400 Subject: [PATCH 4/4] Make service_dates a string for compatibility --- gtfs-realtime/proto/gtfs-realtime.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtfs-realtime/proto/gtfs-realtime.proto b/gtfs-realtime/proto/gtfs-realtime.proto index 6d7de21a..06c04481 100644 --- a/gtfs-realtime/proto/gtfs-realtime.proto +++ b/gtfs-realtime/proto/gtfs-realtime.proto @@ -1124,7 +1124,7 @@ message TripModifications { 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 [default = 0]; + 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;