You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Trip modifications clarifications
- Specify that the shape should be the full shape
- Clarification on usage of ids inside a GTFS-rt
- Clarification that linked entities should be done inside the same feed
- Sync definition of shape_id inside TripProperties between proto and reference
* Fix typo and spacing
Co-authored-by: Stefan de Konink <stefan@konink.de>
* Fix typo and spacing
Co-authored-by: Stefan de Konink <stefan@konink.de>
* Fix bad merge
---------
Co-authored-by: Stefan de Konink <stefan@konink.de>
Copy file name to clipboardExpand all lines: gtfs-realtime/proto/gtfs-realtime.proto
+12-11Lines changed: 12 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -407,13 +407,12 @@ message TripUpdate {
407
407
// populated and will be ignored by consumers.
408
408
// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
409
409
optionalstringstart_time=3;
410
-
// Specifies the shape of the vehicle travel path when the trip shape differs from the shape specified in
411
-
// (CSV) GTFS or to specify it in real-time when it's not provided by (CSV) GTFS, such as a vehicle that takes differing
412
-
// paths based on rider demand. See definition of trips.shape_id in (CSV) GTFS. If a shape is neither defined in (CSV) GTFS
413
-
// nor in real-time, the shape is considered unknown. This field can refer to a shape defined in the (CSV) GTFS in shapes.txt
414
-
// or a Shape in the (protobuf) real-time feed. The order of stops (stop sequences) for this trip must remain the same as
415
-
// (CSV) GTFS. Stops that are a part of the original trip but will no longer be made, such as when a detour occurs, should
416
-
// be marked as schedule_relationship=SKIPPED.
410
+
// Specifies the identifier of the shape of the vehicle travel path when the trip shape differs from the shape specified in (CSV) GTFS
411
+
// or to specify it in real-time when it's not provided by (CSV) GTFS, such as a vehicle that takes differing paths based on rider demand. See definition of trips.shape_id in (CSV) GTFS.
412
+
// If a shape is neither defined in (CSV) GTFS nor in real-time, the shape is considered unknown. This field can refer to a shape defined in the (CSV) GTFS in shapes.txt or a `Shape` in the same (protobuf) real-time feed.
413
+
// The order of stops (stop sequences) for this trip must remain the same as (CSV) GTFS.
414
+
// If it refers to a `Shape` entity in the same real-time feed, the value of this field should be the one of the `shape_id` inside the entity, and _not_ the `id` of `FeedEntity`.
415
+
// Stops that are a part of the original trip but will no longer be made, such as when a detour occurs, should be marked as schedule_relationship=SKIPPED or more details can be provided via a `TripModifications` message.
417
416
// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
418
417
optionalstringshape_id=4;
419
418
@@ -1096,7 +1095,7 @@ message Shape {
1096
1095
// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
1097
1096
optionalstringshape_id=1;
1098
1097
1099
-
// Encoded polyline representation of the shape. This polyline must contain at least two points.
1098
+
// Encoded polyline representation of the shape. This polyline must contain at least two points and represent the full shape of the trip where it's used.
1100
1099
// For more information about encoded polylines, see https://developers.google.com/maps/documentation/utilities/polylinealgorithm
1101
1100
// This field is required as per reference.md, but needs to be specified here optional because "Required is Forever"
1102
1101
// See https://developers.google.com/protocol-buffers/docs/proto#specifying_field_rules
@@ -1186,8 +1185,9 @@ message TripModifications {
1186
1185
messageSelectedTrips {
1187
1186
// 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.
1188
1187
repeatedstringtrip_ids=1;
1189
-
// The ID of the new shape for the modified trips in this SelectedTrips.
1190
-
// 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.
1188
+
// The ID of the new shape for the modified trips in this SelectedTrips.
1189
+
// May refer to a new shape added using a `Shape` message in the same GTFS-RT feed, or to an existing shape defined in the GTFS-Static feed’s shapes.txt.
1190
+
// If it refers to a `Shape` entity in the real-time feed, the value of this field should be the one of the `shape_id` inside the entity, and _not_ the `id` of `FeedEntity`.
1191
1191
optionalstringshape_id=2;
1192
1192
1193
1193
// The extensions namespace allows 3rd-party developers to extend the
@@ -1245,7 +1245,8 @@ message ReplacementStop {
1245
1245
// 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.
1246
1246
optionalint32travel_time_to_stop=1;
1247
1247
1248
-
// 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).
1248
+
// 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 in the same GTFS-RT feed, or to an existing stop defined in the (CSV) GTFS feed’s `stops.txt`.
1249
+
// If it refers to a `Shape` entity in the real-time feed, the value of this field should be the one of the `stop_id` inside the entity, and _not_ the `id` of `FeedEntity`. The replacement stop MUST have `location_type=0` (routable stops).
1249
1250
optionalstringstop_id=2;
1250
1251
1251
1252
// The extensions namespace allows 3rd-party developers to extend the
Copy file name to clipboardExpand all lines: gtfs-realtime/spec/en/reference.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -264,9 +264,9 @@ Defines updated properties of the trip
264
264
|**trip_id**|[string](https://protobuf.dev/programming-guides/proto2/#scalar)| Conditionally required | One | Defines the identifier of a new trip that is a duplicate of an existing trip defined in (CSV) GTFS trips.txt but will start at a different service date and/or time (defined using `TripProperties.start_date` and `TripProperties.start_time`). See definition of `trips.trip_id` in (CSV) GTFS. Its value must be different than the ones used in the (CSV) GTFS. This field is required if `schedule_relationship` is `DUPLICATED`, otherwise this field must not be populated and will be ignored by consumers. <br><br>**Caution:** this field is still **experimental**, and subject to change. It may be formally adopted in the future. |
265
265
|**start_date**|[string](https://protobuf.dev/programming-guides/proto2/#scalar)| Conditionally required | One | Service date on which the duplicated trip will be run. Must be provided in YYYYMMDD format. This field is required if `schedule_relationship` is `DUPLICATED`, otherwise this field must not be populated and will be ignored by consumers. <br><br>**Caution:** this field is still **experimental**, and subject to change. It may be formally adopted in the future. |
266
266
| **start_time** | [string](https://protobuf.dev/programming-guides/proto2/#scalar) | Conditionally required | One | Defines the departure start time of the trip when it’s duplicated. See definition of `stop_times.departure_time` in (CSV) GTFS. Scheduled arrival and departure times for the duplicated trip are calculated based on the offset between the original trip `departure_time` and this field. For example, if a GTFS trip has stop A with a `departure_time` of `10:00:00` and stop B with `departure_time` of `10:01:00`, and this field is populated with the value of `10:30:00`, stop B on the duplicated trip will have a scheduled `departure_time` of `10:31:00`. Real-time prediction `delay` values are applied to this calculated schedule time to determine the predicted time. For example, if a departure `delay` of `30` is provided for stop B, then the predicted departure time is `10:31:30`. Real-time prediction `time` values do not have any offset applied to them and indicate the predicted time as provided. For example, if a departure `time` representing 10:31:30 is provided for stop B, then the predicted departure time is `10:31:30`.This field is required if `schedule_relationship` is `DUPLICATED`, otherwise this field must not be populated and will be ignored by consumers. <br><br>**Caution:** this field is still **experimental**, and subject to change. It may be formally adopted in the future. |
267
+
| **shape_id** | [string](https://protobuf.dev/programming-guides/proto2/#scalar) | Optional | One | Specifies the identifier of the shape of the vehicle travel path when the trip shape differs from the shape specified in (CSV) GTFS or to specify it in real-time when it's not provided by (CSV) GTFS, such as a vehicle that takes differing paths based on rider demand. See definition of `trips.shape_id` in (CSV) GTFS. <br>If a shape is neither defined in (CSV) GTFS nor in real-time, the shape is considered unknown. This field can refer to a shape defined in the (CSV) GTFS in shapes.txt or a `Shape` in the same (protobuf) real-time feed. The order of stops (stop sequences) for this trip must remain the same as (CSV) GTFS. If it refers to a `Shape` entity in the same real-time feed, the value of this field should be the one of the `shape_id` inside the entity, and _not_ the `id` of `FeedEntity`.<br>Stops that are a part of the original trip but will no longer be made, such as when a detour occurs, should be marked as schedule_relationship=SKIPPED or more details can be provided via a `TripModifications` message.<br><br>**Caution:** this field is still **experimental**, and subject to change. It may be formally adopted in the future. |
267
268
|**trip_headsign**|[string](https://protobuf.dev/programming-guides/proto2/#scalar)| Optional | One | Specifies the headsign for this trip when it differs from the original. <br><br>**Caution:** this field is still **experimental**, and subject to change. It may be formally adopted in the future. |
268
269
|**trip_short_name**|[string](https://protobuf.dev/programming-guides/proto2/#scalar)| Optional | One | Specifies the name for this trip when it differs from the original. <br><br>**Caution:** this field is still **experimental**, and subject to change. It may be formally adopted in the future. |
269
-
|**shape_id**|[string](https://protobuf.dev/programming-guides/proto2/#scalar)| Optional | One | Specifies the shape of the vehicle travel path for this trip when it differs from the original. Refers to a shape defined in the (CSV) GTFS or a new shape entity in a real-time feed. See definition of `trips.shape_id` in (CSV) GTFS. <br><br>**Caution:** this field is still **experimental**, and subject to change. It may be formally adopted in the future. |
270
270
271
271
## _message_ VehiclePosition
272
272
@@ -615,7 +615,7 @@ Describes the physical path that a vehicle takes when the shape is not part of t
|**shape_id**|[string](https://protobuf.dev/programming-guides/proto2/#scalar)| Required | One | Identifier of the shape. Must be different than any `shape_id` defined in the (CSV) GTFS. <br><br>**Caution:** this field is still **experimental**, and subject to change. It may be formally adopted in the future. |
618
-
|**encoded_polyline**|[string](https://protobuf.dev/programming-guides/proto2/#scalar)| Required | One | 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 <br><br>**Caution:** this field is still **experimental**, and subject to change. It may be formally adopted in the future. |
618
+
|**encoded_polyline**|[string](https://protobuf.dev/programming-guides/proto2/#scalar)| Required | One | Encoded polyline representation of the shape. This polyline must contain at least two points and represent the full shape of the trip where it's used. For more information about encoded polylines, see https://developers.google.com/maps/documentation/utilities/polylinealgorithm <br><br>**Caution:** this field is still **experimental**, and subject to change. It may be formally adopted in the future. |
619
619
620
620
## _message_ Stop
621
621
@@ -717,7 +717,7 @@ List of selected trips with an associated shape.
|**trip_ids**|[uint32](https://protobuf.dev/programming-guides/proto2/#scalar)| Many | One | A list of trip_id from the original (CSV) GTFS that are affected by the containing replacement. Need to contain at least one trip_id. A `TripUpdate` with `schedule_relationship=REPLACEMENT` must not already exist for the trip. |
720
-
|**shape_id**|[string](https://protobuf.dev/programming-guides/proto2/#scalar)| Required | One | 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. |
720
+
|**shape_id**|[string](https://protobuf.dev/programming-guides/proto2/#scalar)| Required | One | The ID of the new shape for the modified trips in this SelectedTrips. May refer to a new shape added using a `Shape` message in the same GTFS-RT feed, or to an existing shape defined in the GTFS-Static feed’s shapes.txt. If it refers to a `Shape` entity in the real-time feed, the value of this field should be the one of the `shape_id` inside the entity, and _not_ the `id` of `FeedEntity`. |
721
721
722
722
## _message_ ReplacementStop
723
723
@@ -733,5 +733,5 @@ _If a modification affects the first stop of the trip, that stop also serves as
|**stop_id**|[string](https://protobuf.dev/programming-guides/proto2/#scalar)| Required | One | 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 (CSV) GTFS feed’s `stops.txt`. The stop MUST have `location_type=0` (routable stops). |
736
+
|**stop_id**|[string](https://protobuf.dev/programming-guides/proto2/#scalar)| Required | One | 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 in the same GTFS-RT feed, or to an existing stop defined in the (CSV) GTFS feed’s `stops.txt`. If it refers to a `Shape` entity in the real-time feed, the value of this field should be the one of the `stop_id` inside the entity, and _not_ the `id` of `FeedEntity`. The stop MUST have `location_type=0` (routable stops). |
737
737
|**travel_time_to_stop**|[int32](https://protobuf.dev/programming-guides/proto2/#scalar)| Optional | One | 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_selector`. If the modification begins at the first stop of the trip, then the first stop of the trip is the reference stop. <br/><br/>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. <br/><br/>If the value is not supplied, consumers MAY interpolate or infer the `travel_time_to_stop` based on other data. |
0 commit comments