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

Proposal: Add MODIFIED and pickup and drop-off types to GTFS-RT; experimentally deprecate SKIPPED #265

Closed
Show file tree
Hide file tree
Changes from 3 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
43 changes: 42 additions & 1 deletion gtfs-realtime/proto/gtfs-realtime.proto
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ message FeedMessage {
// Metadata about a feed, included in feed messages.
message FeedHeader {
// Version of the feed specification.
// The current version is 2.0. Valid versions are "2.0", "1.0".
// The current version is 2.0. Valid versions are "3.0", "2.0", "1.0".
ericouyang marked this conversation as resolved.
Show resolved Hide resolved
// NOTE: Version 3.0 is still experimental, and subject to change. It may be formally adopted in the future.
required string gtfs_realtime_version = 1;

// Determines whether the current fetch is incremental. Currently,
Expand Down Expand Up @@ -260,6 +261,46 @@ message TripUpdate {
// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
optional string assigned_stop_id = 1;

// See definition of stop_times.pickup_type in (CSV) GTFS. Default is REGULAR_PICKUP.
// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
optional PickupType pickup_type = 2 [default = REGULAR_PICKUP];

// See definition of stop_times.drop_off_type in (CSV) GTFS. Default is REGULAR_DROP_OFF.
// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
optional DropOffType drop_off_type = 3 [default = REGULAR_DROP_OFF];

// Indicates the pickup method for an updated stop time. Default is REGULAR_PICKUP.
// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
enum PickupType {
// See definition of stop_times.pickup_type=0 in (CSV) GTFS.
REGULAR_PICKUP = 0;

// See definition of stop_times.pickup_type=1 in (CSV) GTFS.
NO_PICKUP = 1;

// See definition of stop_times.pickup_type=2 in (CSV) GTFS.
MUST_PHONE_AGENCY_PICKUP = 2;

// See definition of stop_times.pickup_type=3 in (CSV) GTFS.
MUST_ASK_DRIVER_PICKUP = 3;
}

// Indicates the drop off method for an updated stop time. Default is REGULAR_DROP_OFF.
// NOTE: This field is still experimental, and subject to change. It may be formally adopted in the future.
enum DropOffType {
// See definition of stop_times.drop_off_type=0 in (CSV) GTFS.
REGULAR_DROP_OFF = 0;

// See definition of stop_times.drop_off_type=1 in (CSV) GTFS.
NO_DROP_OFF = 1;

// See definition of stop_times.drop_off_type=2 in (CSV) GTFS.
MUST_PHONE_AGENCY_DROP_OFF = 2;

// See definition of stop_times.drop_off_type=3 in (CSV) GTFS.
MUST_ASK_DRIVER_DROP_OFF = 3;
}

// 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
38 changes: 36 additions & 2 deletions gtfs-realtime/spec/en/reference.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
A GTFS Realtime feed lets transit agencies provide consumers with realtime information about disruptions to their service (stations closed, lines not operating, important delays, etc.) location of their vehicles, and expected arrival times.

Version 2.0 of the feed specification is discussed and documented on this site. Valid versions are "2.0", "1.0".
Version 3.0 of the feed specification is discussed and documented on this site. The current version is 2.0. Valid versions are "3.0", "2.0", "1.0".

Note: Version 3.0 is still experimental, and subject to change. It may be formally adopted in the future.

### Term Definitions

Expand Down Expand Up @@ -92,7 +94,7 @@ Metadata about a feed, included in feed messages.

| _**Field Name**_ | _**Type**_ | _**Required**_ | _**Cardinality**_ | _**Description**_ |
|------------------|------------|----------------|-------------------|-------------------|
| **gtfs_realtime_version** | [string](https://developers.google.com/protocol-buffers/docs/proto#scalar) | Required | One | Version of the feed specification. The current version is 2.0. |
| **gtfs_realtime_version** | [string](https://developers.google.com/protocol-buffers/docs/proto#scalar) | Required | One | Version of the feed specification. The current version is 2.0. Valid versions are "3.0", "2.0", "1.0". <br><br>**Caution:** Version 3.0 is still **experimental**, and subject to change. It may be formally adopted in the future. |
| **incrementality** | [Incrementality](#enum-incrementality) | Required | One |
| **timestamp** | [uint64](https://developers.google.com/protocol-buffers/docs/proto#scalar) | Required | One | This timestamp identifies the moment when the content of this feed has been created (in server time). In POSIX time (i.e., number of seconds since January 1st 1970 00:00:00 UTC). To avoid time skew between systems producing and consuming realtime information it is strongly advised to derive timestamp from a time server. It is completely acceptable to use Stratum 3 or even lower strata servers since time differences up to a couple of seconds are tolerable. |

Expand Down Expand Up @@ -213,6 +215,38 @@ Realtime update for certain properties defined within GTFS stop_times.txt.
| _**Field Name**_ | _**Type**_ | _**Required**_ | _**Cardinality**_ | _**Description**_ |
|------------------|------------|----------------|-------------------|-------------------|
| **assigned_stop_id** | [string](https://developers.google.com/protocol-buffers/docs/proto#scalar) | Optional | One | Supports real-time stop assignments. Refers to a `stop_id` defined in the GTFS `stops.txt`. <br> The new `assigned_stop_id` should not result in a significantly different trip experience for the end user than the `stop_id` defined in GTFS `stop_times.txt`. In other words, the end user should not view this new `stop_id` as an "unusual change" if the new stop was presented within an app without any additional context. For example, this field is intended to be used for platform assignments by using a `stop_id` that belongs to the same station as the stop originally defined in GTFS `stop_times.txt`. <br> To assign a stop without providing any real-time arrival or departure predictions, populate this field and set `StopTimeUpdate.schedule_relationship = NO_DATA`. <br> If this field is populated, `StopTimeUpdate.stop_sequence` must be populated and `StopTimeUpdate.stop_id` should not be populated. Stop assignments should be reflected in other GTFS-realtime fields as well (e.g., `VehiclePosition.stop_id`). <br><br>**Caution:** this field is still **experimental**, and subject to change. It may be formally adopted in the future. |
| **pickup_type** | [PickupType](#enum-pickuptype) | Optional | One | See definition of stop_times.pickup_type in (CSV) GTFS. Default is REGULAR_PICKUP. <br><br>**Caution:** this field is still **experimental**, and subject to change. It may be formally adopted in the future. |
| **drop_off_type** | [DropOffType](#enum-dropofftype) | Optional | One | See definition of stop_times.drop_off_type in (CSV) GTFS. Default is REGULAR_DROP_OFF. <br><br>**Caution:** this field is still **experimental**, and subject to change. It may be formally adopted in the future. |

## _enum_ PickupType

Indicates the pickup method for an updated stop time. Default is REGULAR_PICKUP.

**Caution:** this field is still **experimental**, and subject to change. It may be formally adopted in the future.

#### Values

| _**Value**_ | _**Comment**_ |
|-------------|---------------|
| **REGULAR_PICKUP** | See definition of stop_times.pickup_type=0 in (CSV) GTFS. |
| **NO_PICKUP** | See definition of stop_times.pickup_type=1 in (CSV) GTFS. |
| **MUST_PHONE_AGENCY_PICKUP** | See definition of stop_times.pickup_type=2 in (CSV) GTFS. |
| **MUST_ASK_DRIVER_PICKUP** | See definition of stop_times.pickup_type=3 in (CSV) GTFS. |

## _enum_ DropOffType

Indicates the drop off method for an updated stop time. Default is REGULAR_DROP_OFF.

**Caution:** this field is still **experimental**, and subject to change. It may be formally adopted in the future.

#### Values

| _**Value**_ | _**Comment**_ |
|-------------|---------------|
| **REGULAR_DROP_OFF** | See definition of stop_times.drop_off_type=0 in (CSV) GTFS. |
| **NO_DROP_OFF** | See definition of stop_times.drop_off_type=1 in (CSV) GTFS. |
| **MUST_PHONE_AGENCY_DROP_OFF** | See definition of stop_times.drop_off_type=2 in (CSV) GTFS. |
| **MUST_ASK_DRIVER_DROP_OFF** | See definition of stop_times.drop_off_type=3 in (CSV) GTFS. |

## _message_ TripProperties

Expand Down