google / google/transit

Clarify whether GTFS-RT `VehiclePositions.current_stop_sequence` refers to GTFS Schedule `stop_times.stop_sequence`

Open
#642 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
1.1k
Forks
225
Avg merge
7d 17h
Merged PRs (30d)
3

Description

### Introduce yourself

I'm asking due to a related questions that has arisen on TIDES: https://github.com/TIDES-transit/TIDES/discussions/263.

### Ask a question

GTFS-RT `VehiclePosition` messages have a [`current_stop_sequence` attribute](https://gtfs.org/documentation/realtime/reference/#message-vehicleposition), defined as:

> The stop sequence index of the current stop. The meaning of current_stop_sequence (i.e., the stop that it refers to) is determined by current_status. If current_status is missing IN_TRANSIT_TO is assumed.

This documentation is ambiguous as to whether `current_stop_sequence` is intended to refer to the same thing as [`StopTimeUpdate.stop_sequence`](https://gtfs.org/documentation/realtime/reference/#message-stoptimeupdate), which is defined as:

> Must be the same as in stop_times.txt in the corresponding GTFS feed. Either stop_sequence or stop_id must be provided within a StopTimeUpdate - both fields cannot be empty. stop_sequence is required for trips that visit the same stop_id more than once (e.g., a loop) to disambiguate which stop the prediction is for. If `StopTimeProperties.assigned_stop_id` is populated, then `stop_sequence` must be populated. Required if `TripUpdate.schedule_relationship` is NEW or REPLACEMENT, and the value must be increasing along the trip.

**So, the question is -- can `VehiclePosition.current_stop_sequence` be safely assumed to correspond to `StopTimeUpdate.stop_sequence`/`stop_times.stop_sequence` or not?**

This is particularly relevant vis a vis relationship to TIDES because [TIDES vehicle locations has a distinct `trip_stop_sequence` field](https://tides-transit.org/main/tables/#vehicle-locations) which is specifically defined differently from `stop_times.stop_sequence`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.