Skip to content

Import transit stations and add station ranking and area suppression - #22

Merged
kylerchin merged 1 commit into
mainfrom
feat/transit-search
Nov 13, 2026
Merged

kylerchin merged 1 commit into
mainfrom
feat/transit-search

Conversation

@kylerchin

Copy link
Copy Markdown
Member

Cypress currently filters out ordinary transit stations and does not classify plain railway stations or bus stops as venues. Import station-level destinations and add shared transit ranking across search and autocomplete.

  • Enable rail, metro/light rail, tram, bus and ferry destinations while rejecting platforms, stop positions, entrances and inactive facilities, including when they carry other POI/address tags. Use explicit station/mode tags following the backend importer’s classification approach.
  • Add the default relevance prior rail → metro/light rail → tram → bus, plus optional prefer_train_stations=true to strengthen it. Apply it before candidate and final result truncation.
  • Add optional suppress_cities_near_stations=true: a returned, higher-ranked rail station may suppress a similarly named locality within 3 km; metro/tram stations may suppress a neighbourhood within 1 km. Require compatible administrative context and equal-or-better lexical relevance, preserve qualifiers such as North/Airport, and refill from a bounded candidate pool. Missing or filtered stations cannot erase an area.
  • Support both flags on v1/v2 search and v1 autocomplete, defaulting to false. Preference-only autocomplete stays mmap-only; suppression/layer filtering hydrates candidates through the search path.
  • Stream one transit byte per place into dense format v2 while retaining v1 read compatibility and the existing place-record/rkyv formats. Invalidate wrapper-script filtered PBF caches when filtering rules change.

Validation: cargo check --locked --all-targets, cargo test --locked --all-targets (95 passed, one pre-existing ignored), cargo fmt --all -- --check, shell syntax checks, and git diff --check. Tests include real mmap top-1 ranking and alternating flags with a warmed query cache, import/category round trips, platform exclusion, v1/v2 compatibility, parameter parsing, suppression guards and refill. No production dataset import or latency benchmark was run.

Rollout: regenerate filtered PBFs, reimport with --refresh, and recompile. Deploy the new query binary before publishing dense v2; rolling back the binary also requires the older compiled generation. This imports explicit OSM destinations and station multipolygons; it does not synthesize stations from platform-only stop areas or import GTFS. Details and commands are in docs/transit-search.md.

@kylerchin
kylerchin merged commit 36f8079 into main Nov 13, 2026
1 check passed
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