Skip to content

Bend bike routes + classified network overlay (Casual mode)#93

Merged
kwiens merged 2 commits into
mainfrom
feat/bend-bike-network
Jun 22, 2026
Merged

Bend bike routes + classified network overlay (Casual mode)#93
kwiens merged 2 commits into
mainfrom
feat/bend-bike-network

Conversation

@kwiens

@kwiens kwiens commented Jun 22, 2026

Copy link
Copy Markdown
Owner

Adds Bend's Casual-mode cycling content — both rebuilt from OpenStreetMap and inspired by bendbikes.org (data © OpenStreetMap; credited on the About page). Complements the curated MTB pane that landed in #91.

What's in it

1. Classified bike-network overlay

A toggleable overlay that color-codes Bend's streets/paths by comfort, like a low-stress-network map.

  • scripts/build_bend_bike_network.py — one Overpass query for a Bend bbox, grades ~6.2k OSM ways into five tiers via OSM tags (LTS-lite): paved trail / unpaved trail / bike lane / calm street / use cautionpublic/data/bend/bike-network.geojson (489 KB gzipped).
  • ensureBendNetworkSource / setBendNetworkVisible render two stacked line layers (base tint + infra on top), beneath labels.
  • Toggled from the Casual sidebar via BikeNetworkLayer (toggle + color legend); city-gated by bikeNetworkUrl (hidden for Chattanooga).

2. Greenway routes

Eight named multi-use paths surfaced in the routes sidebar (Chattanooga-parity), distinct from the MTB singletrack.

  • scripts/build_bend_routes.py — collects each route's segments by OSM name → public/data/bend/routes.geojson + bend/bike-routes.data.ts (Deschutes River Trail 13.2 mi, Discovery, Rimrock, Haul Road, Larkspur, Cascade Highlands, Tumalo Creek, West Bend).
  • New ensureInlineRoutes attaches a per-route line/casing/hit layer from GeoJSON keyed by id, so the existing route select/zoom/click/highlight flow works unchanged. City-gated by bikeRoutesUrl (Chattanooga keeps its Studio-layer routes).

Architecture notes

  • Both overlays are city-gated via new optional CityData fields (bikeNetworkUrl, bikeRoutesUrl) — no impact on Chattanooga.
  • Geometry ships as static GeoJSON, attached at runtime (same pattern as the OSM trails layer). No Mapbox Studio uploads.
  • OSM + Bend Bikes credit on the About page; removed from the sidebar.

Verification

  • pnpm typecheck, pnpm lint clean; 367 tests pass.
  • ✅ Browser-verified (Bend): network overlay renders all 5 classes (1,809 features in view, legend, toggle, labels on top); all 8 routes list with colors/distances; selecting the Deschutes River Trail highlights the correct river-tracing geometry and flies to bounds; zero console errors.

plan.md captures the multi-city roadmap (Phase 3 = prove "any city" from OSM).

🤖 Generated with Claude Code

Two OSM-derived additions to Bend's Casual mode, inspired by bendbikes.org
(data © OpenStreetMap; credited on the About page):

- Classified bike-network overlay: scripts/build_bend_bike_network.py grades
  ~6.2k OSM ways in a Bend bbox into five comfort tiers (paved/unpaved trail,
  bike lane, calm street, use caution) -> public/data/bend/bike-network.geojson.
  ensureBendNetworkSource renders two stacked line layers, toggled from the
  Casual sidebar (BikeNetworkLayer + 5-class legend), city-gated by
  bikeNetworkUrl.

- Greenway routes: scripts/build_bend_routes.py stitches 8 named multi-use
  paths (Deschutes River Trail, Discovery, Rimrock, Haul Road, ...) ->
  routes.geojson + bend/bike-routes.data.ts. ensureInlineRoutes attaches a
  per-route line/casing/hit layer from GeoJSON keyed by id, so the existing
  route select/zoom/click flow works unchanged. City-gated by bikeRoutesUrl.

plan.md captures the multi-city roadmap.
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bikemap Ready Ready Preview Jun 22, 2026 11:36pm

Request Review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f9c3904952

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/data/cities/bend/index.ts
- Lazy-attach the multi-MB network GeoJSON on first toggle instead of at
  startup, so users who never open the overlay don't download it (#1).
- Classify untagged path/footway/bridleway as unpaved (only explicitly-paved
  surfaces are 'paved trail'); cycleways still default paved (#2).
- Share a firstSymbolLayerId() helper for label-aware layer insertion (#3).
- Consolidate slugify into scripts/_geo.py; build_bend_routes reuses
  line_length_m from osm_trail_elevation (#4, #8).
- Reuse buildColorExpression for the network color; collapse the network and
  inline-route layer creation into spec-driven loops (#5, #7).
- De-Bend the generic mechanism: bend-network.ts -> bike-network.ts,
  BEND_NETWORK_* -> BIKE_NETWORK_*, ensureBendNetworkSource ->
  ensureBikeNetworkSource, event bendNetwork -> bikeNetwork, source ids ->
  bike-network-source / inline-routes-source; build script takes --region/--out
  for reuse (#6).
- Key the Overpass cache by query hash so a different --bbox doesn't reuse a
  stale extent (P3).
- Export reads inline-route geometry from the GeoJSON when bikeRoutesUrl is set,
  so Bend's /export finds features and enables GPX/SVG (P2).
@kwiens
kwiens merged commit c55c1a2 into main Jun 22, 2026
3 checks 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