feat: add NYC buses and Westchester Bee-Line #3

Merged
madeddie merged 1 commit from bus-feeds into main 2026-11-07 11:18:18 -05:00
Owner

Adds a bus route mode and two feeds. Stacked on #2 (base is perf-typed-feeds) - the old loader cannot hold these feeds.

Feeds

  • NYC buses: the MTA publishes one feed per borough plus MTA Bus Company. They share stops and route ids, so loading them as separate feeds would duplicate stations and invent walking transfers between a stop and itself. scripts/merge-gtfs.mjs merges the six into one bus feed (keyed files deduped, trips/stop_times streamed and concatenated).
  • Bee-Line (Westchester, incl. Yonkers): taken from the 511NY-hosted mirror. Westchester's own published copy is stale - it expired in August 2025 - while the mirror runs through February 2027.
  • fetch-gtfs.sh now also drops shapes.txt, which the server never reads and which is most of the unpacked size.

Fares

  • one MTA fare covers subway and local bus together (OMNY free transfer)
  • an express bus (BM/QM/BxM/X routes) upgrades that single fare to $7
  • Bee-Line is a flat $2.75 of its own, with free transfers within Bee-Line and no free transfer to the MTA
  • Metro-North unchanged

Verification

scripts/bench.ts (included) loads the feeds and plans a fixed set of trips. With all four feeds: 16,911 stations, 293,660 trips, 248MB heap.

  • Overlook Terrace -> Bronx Zoo now returns subway + BX12+ at $3.00 (one fare across subway and bus)
  • Grand Central -> Coney Island offers an X38 express option priced at $7.00
  • Getty Square, Yonkers -> Woodlawn returns Bee-Line route 4 at $2.75, and a 7 -> 20 transfer still at $2.75
  • Astoria -> JFK mixes subway with Q06/Q3

Known follow-up

Startup is now ~130s and a query up to ~12s with buses enabled. That is loading and scan cost, not correctness, and I would rather fix it in its own PR than inflate this one: the obvious moves are caching the parsed feeds to a binary file at build time (so the container starts in seconds) and restricting the scan to stations near the corridor.

Adds a `bus` route mode and two feeds. **Stacked on #2** (base is `perf-typed-feeds`) - the old loader cannot hold these feeds. ## Feeds - **NYC buses**: the MTA publishes one feed per borough plus MTA Bus Company. They share stops and route ids, so loading them as separate feeds would duplicate stations and invent walking transfers between a stop and itself. `scripts/merge-gtfs.mjs` merges the six into one `bus` feed (keyed files deduped, trips/stop_times streamed and concatenated). - **Bee-Line** (Westchester, incl. Yonkers): taken from the 511NY-hosted mirror. Westchester's own published copy is stale - it expired in August 2025 - while the mirror runs through February 2027. - `fetch-gtfs.sh` now also drops `shapes.txt`, which the server never reads and which is most of the unpacked size. ## Fares - one MTA fare covers subway **and** local bus together (OMNY free transfer) - an express bus (`BM`/`QM`/`BxM`/`X` routes) upgrades that single fare to $7 - Bee-Line is a flat $2.75 of its own, with free transfers within Bee-Line and no free transfer to the MTA - Metro-North unchanged ## Verification `scripts/bench.ts` (included) loads the feeds and plans a fixed set of trips. With all four feeds: **16,911 stations, 293,660 trips, 248MB heap.** - Overlook Terrace -> Bronx Zoo now returns subway + `BX12+` at $3.00 (one fare across subway and bus) - Grand Central -> Coney Island offers an `X38` express option priced at $7.00 - **Getty Square, Yonkers -> Woodlawn** returns Bee-Line route 4 at $2.75, and a 7 -> 20 transfer still at $2.75 - Astoria -> JFK mixes subway with `Q06`/`Q3` ## Known follow-up Startup is now ~130s and a query up to ~12s with buses enabled. That is loading and scan cost, not correctness, and I would rather fix it in its own PR than inflate this one: the obvious moves are caching the parsed feeds to a binary file at build time (so the container starts in seconds) and restricting the scan to stations near the corridor.
Adds a 'bus' route mode and two feeds: NYC buses (the MTA publishes one
feed per borough plus MTA Bus Company, merged into a single 'bus' feed
by scripts/merge-gtfs.mjs because they share stops and route ids) and
Westchester's Bee-Line, which covers Yonkers.

Bee-Line comes from the 511NY-hosted mirror: Westchester's own copy of
the feed is published stale (it expired in August 2025), the mirror is
current.

Fares: one MTA fare covers subway and local bus together (OMNY gives a
free transfer between them), an express bus (BM/QM/BxM/X routes)
upgrades that single fare to $7, Bee-Line is a flat $2.75 of its own
with no free transfer to the MTA, and Metro-North is unchanged.

scripts/bench.ts is the load/route harness used to check this.
madeddie changed target branch from perf-typed-feeds to main 2026-11-07 11:18:11 -05:00
madeddie deleted branch bus-feeds 2026-11-07 11:18:19 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
madeddie/ptt!3
No description provided.