Skip to content

Measure every rail feed of the Interrail countries - #16

Open
davd-gzl wants to merge 5 commits into
offline-searchfrom
europe-probe
Open

davd-gzl wants to merge 5 commits into
offline-searchfrom
europe-probe

Conversation

@davd-gzl

@davd-gzl davd-gzl commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Before: we didn't know how big "every train in Europe" is, so we couldn't size a search server for it. Also, stations sharing a name in different towns ("Gare SNCF" in 13 French towns) became one station, and Munich's place was named after a tram stop called "Hauptbahnhof (U, Tram)".

After: a "Europe probe" workflow reads every rail feed of the 33 Interrail countries. Its run summary lists, for each country, the trips, stations, bundle size and the names it had to tell apart. It then shows the engine's memory, load time and search times over all of Europe at once. Same-name stations more than 3 km apart stay separate ("Gare SNCF (2)"), and a place takes a name its stations share ("München Hbf").

First results: 405k trips and 39k stations in 32 countries (Bosnia missing). That is 13.8 MB gzipped. The engine holds it in about 300 MB of heap and answers in 0.03 to 0.6 s.

How:

  • scripts/probe-europe.ts lists Transitous's feed mirror (https://api.transitous.org/gtfs/, which invites reuse) and downloads one feed at a time. It keeps GTFS rail routes (route_type 2 and 100–117), merges each country's feeds with the new mergeTimetables, and encodes one v2 bundle per country. It then loads them all into Network and times sample searches and a one-day "reachable from Paris".
  • readGtfsTimetable gains { v1: false }, which skips the per-stop-pair rows. It now keys stations by id and numbers a name used for places more than 3 km apart, reporting those names in sameName.
  • In Network, a place's name is now one its other stations share, with ties going to the busiest station.
  • The workflow runs on changes to the probe or by hand, so normal CI stays fast. Locally: npm run probe:europe -- <folder of zips>.

Stacked on #15.

…server

A probe reads Transitous's mirror of Europe's GTFS feeds, keeps rail routes,
and prints per country the trips, stations and bundle sizes, then the search
engine's memory and speed over all of them. It runs in its own workflow, on
changes to it or by hand. readGtfsTimetable can skip the v1 rows.
@davd-gzl
davd-gzl marked this pull request as ready for review November 1, 2026 15:11
German feeds name many stops just "Hauptbahnhof", so keying stations by name
merges towns. The GTFS reader now lists each name served by stations more than
3 km apart, and the probe counts them per country with examples.
Regional feeds name stops just "Gare SNCF", and bundles key stations by name,
so trips jumped between towns. Within a feed and across a country's feeds, a
name placed more than 3 km from its namesake now takes a number, "Gare SNCF (2)".
The probe merges each country's feeds this way and shows which stations each
searched name resolved to.
Munich's place took the name of its busiest station, a tram stop called
"Hauptbahnhof (U, Tram)". A name the place's other stations share (München Hbf,
München Hauptbahnhof) now wins over a busier one that doesn't name the town.
Counting only differently named stations favoured an odd one out: Zürich HB's
place took another stop's name and left the Zürich town. A place now takes the
name most of its stations normalize to, then one sharing a word with most, then
the busiest.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant