stop_without_stop_time fires for platform stops used only by GTFS-Realtime assigned_stop_id

Open
#2,262 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
java
Domain
backend

Research direction

Start with LocationHasStopTimesValidator.java and inspect how it identifies stops referenced by stop_times.txt and applies the existing location group exemption. Update the warning logic for the sibling platform stops described in the proposal, then run the validator tests covering StopWithoutStopTimeNotice. Done when qualifying stops no longer produce the warning while unrelated stops without stop times still do.

Written by the indexing model from the issue text.

Description

Summary

stop_without_stop_time (WARNING) fires for platform stops that a feed publishes only so that GTFS-Realtime can assign them through TripUpdate.StopTimeUpdate.StopTimeProperties.assigned_stop_id. Those stops are intended, and the GTFS-Realtime reference describes this exact use: assigned_stop_id "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". A static feed can't name such a stop in stop_times.txt without dropping the stop the schedule really uses, so the warning can't be fixed in the feed.

Current behavior

LocationHasStopTimesValidator emits StopWithoutStopTimeNotice for every location_type 0 stop that stop_times.txt doesn't reference. The only exemption is stops reached through location_group_stops.txt (#1883).

Minimal example

stops.txt:

stop_id,stop_name,stop_lat,stop_lon,location_type,parent_station,platform_code
NHV:station,New Haven,41.2978,-72.9265,1,,
NHV,New Haven,41.2978,-72.9265,0,NHV:station,
NHV:track:1,New Haven Track 1,41.2978,-72.9265,0,NHV:station,1
NHV:track:2,New Haven Track 2,41.2978,-72.9265,0,NHV:station,2

stop_times.txt references only NHV, and a TripUpdate sets assigned_stop_id: "NHV:track:2" for that stop time. By the logic above, stop_without_stop_time fires for NHV:track:1 and NHV:track:2. With v8.0.1, a real feed built this way gets 35 of these notices, one for every platform it publishes and none for anything else.

Proposal

Don't emit stop_without_stop_time for a location_type 0 stop that:

  • has a parent_station, and
  • has a non-empty platform_code, and
  • has a sibling (another child of the same parent_station) that stop_times.txt does reference.

That combination is what a realtime platform assignment needs, and a typo in stop_times.txt, which this notice exists to catch, is unlikely to produce it. If a silent exemption is too broad, an INFO-level notice for such stops would keep them visible without the warning.

Dominant language
Java
Stars
426
Forks
127
Avg merge
2d 10h
Merged PRs (30d)
27

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MobilityData/gtfs-validator

All issues in MobilityData/gtfs-validator

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.