Skip to content

fix(transit): link a station's stops by its local name, not a translation - #725

Merged
Medformatik merged 1 commit into
mainfrom
fix/transit-link-local-name
Oct 31, 2026
Merged

Medformatik merged 1 commit into
mainfrom
fix/transit-link-local-name

Conversation

@Medformatik

Copy link
Copy Markdown
Collaborator

Summary

Part of #401. A station's board links its transit stops by the place's name. That name is often a translation: place details always resolve in English, so München Hauptbahnhof shows as "Munich Central Station" whatever the UI language. Transit sources name stops locally, so a search for "Munich Central Station" found only "Munich central bus station", and the board showed FlixBus coaches and no trains. The server also cached each place's links under the place id alone for 24 hours. Whichever name reached it first decided that board for everyone.

Changes:

  • Places know their local name. The OSM lookup now keeps OSM's own name tag as Place.localName (e.g. "München Hauptbahnhof"). It used to drop it as "display only".

  • Board requests carry what links stops better than the shown name. A shared placeTransitParams used by all six board hooks sends:

    The query keys include both.

  • The server links by the local name. For an osm_id, the board looks up the local name through the osm place resolver. The geocoding integration registers that resolver with the operator's Nominatim. It's cached for a day; if it's missing or fails, the board uses the shown name. Linking searches for:

    • the local name, otherwise the shown name;
    • the name of the stop the place was opened for.

    Each name keeps the stops it would link on its own. Pooling the names' words would let one name's distinctive words prune the other's stops. The main stop of feat(transit): name the stop a station board departure leaves from #714 is matched against the local name.

  • Cache identity includes the linking names, not only the place id. A board found by one name can no longer stand in for another.

  • PlaceTransit takes one PlaceQuery (position, shown name, place id, OSM object, opened stop) instead of growing positional parameters. The routes parse it once.

Before (main, openmapx.com, place "Munich Central Station"): the transit section lists only coaches from the coach station.

Before: Munich Central Station's transit section with FlixBus lines and coach departures only

After: the same place, linked by "München Hauptbahnhof": ICE, S-Bahn and trams.

After: Munich Central Station's transit section with ICE and tram lines and S-Bahn and tram departures

The after view comes from a local web build of this branch against openmapx.com. A local proxy built the board and line chips with this branch's code. It got the local name from the same Nominatim lookup. For the stop search, it used production's linked stops for each name, so the result shows this branch's choice of names rather than its full search. Some rows in it, such as "DB S3 (Zug-Nr. 6397)" next to "S3", are decorated line names and double listings, which #724 fixes.

Validation:

  • New tests cover:
    • linking by the looked-up local name instead of the translated one;
    • falling back to the shown name when the lookup fails;
    • ignoring a malformed OSM reference;
    • also linking by the opened stop's name;
    • separate cached links for different names;
    • the OSM lookup keeping localName;
    • the hooks sending osm_id.
  • Existing board tests now use PlaceQuery.
  • Full Vitest run: 24,460 passed, 0 failed. check-types passes for apps/api, apps/web and packages/core, and Biome is clean.
  • Not run locally: the docs build.

Release and upgrade impact

Product impact: ordinary
No package release: the built @openmapx/extension-contracts and @openmapx/extension-cli packages are byte-identical to main (both built and compared); the changed shared code is the web Place type, the transit board hooks and the transit integration's dependencies, none of which they ship.

@Medformatik Medformatik added the integration New or changed provider, source or backend integration label Oct 31, 2026
@Medformatik Medformatik self-assigned this Oct 31, 2026
…tion

Place details are always in English, so München Hauptbahnhof showed as "Munich Central Station" and its board linked only the coach station of that name. The OSM lookup now keeps OSM's own name tag (Place.localName); board requests send the place's OSM object and opened stop; the server links stops by the local name, looked up through the OSM place resolver, and by the opened stop's name, and keys cached links by those names rather than the place id alone.
@Medformatik
Medformatik force-pushed the fix/transit-link-local-name branch from c7b0847 to 0e058f4 Compare October 31, 2026 18:26
@Medformatik
Medformatik merged commit caf4fa5 into main Oct 31, 2026
28 checks passed
@Medformatik
Medformatik deleted the fix/transit-link-local-name branch October 31, 2026 18:45
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 31, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

integration New or changed provider, source or backend integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant