Skip to content

stop_id collisions silently discard a physical stop location #140

Description

@0xaboomar

Problem

When two configured static feeds contain the same stop_id but assign it different latitude/longitude coordinates, mergeStaticAndDiscoverAgencies (internal/gtfs/gtfs_bundles.go:264-293) keeps the first occurrence and silently discards the second location.

Currently, only a Sentry warning is emitted.

This means the second physical stop becomes completely invisible to the system. In particular, its location cannot be used by:

  • Bounding-box validation.
  • Stop resolution.
  • Other logic that relies on the merged stop lookup.

Current constraint

Until this is fixed, multi-feed configurations must not contain stop_id collisions.

In practice, configurations should use a static feed bundle that has already been merged outside Watchdog rather than relying on Watchdog to combine multiple per-agency feeds that may contain overlapping stop_ids.

Proposed fix

Instead of discarding the duplicate location, preserve the conflicting locations and make them available to the relevant processing paths.

The bbox-check and unmatched-stop resolution paths should then operate with the appropriate location and expose conflicts through per-(agency, stop_id) metrics where necessary.

This issue is also closely related to #137 : once bounding boxes become agency-specific, preserving the correct physical location for a colliding stop_id becomes even more important. A union-based stop lookup can only return one location for a duplicated ID, which can lead to incorrect agency-level bounding-box and stop-resolution behavior.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions