Skip to content

Add route-card normalization for OSRM/direct paths and surface turn segments in UI - #10

Merged
PowerShellYoungTeam merged 1 commit into
mainfrom
copilot/research-osm-data-fetching
Sep 28, 2026
Merged

PowerShellYoungTeam merged 1 commit into
mainfrom
copilot/research-osm-data-fetching

Conversation

Copilot AI commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Current movement/pathfinding computed only geometry + aggregate distance/duration, with no reusable per-segment instruction model for route-card generation. This change introduces a normalized route-card structure from OSRM steps and direct-path fallback, then threads it through existing movement events to render a route-card table.

  • Route normalization in pathfinding core

    • Extended OSRM requests with steps=true and mapped legs[].steps[] into canonical route-card rows.
    • Added direct-path synthetic row generation (bearing/cardinal-based direction text) when OSRM is not used.
    • Attached normalized rows to path.routeCard alongside existing coordinates/distance/duration/type/travelMode.
  • Route-card schema

    • Added row fields for:
      • serial, from, to, directionText
      • segmentDistance, cumulativeDistance
      • travelMode, pathType
      • maneuver metadata (roadName, maneuverType, modifier)
  • Event/data propagation

    • Included routeCard in movement-start payloads and path info updates so existing flow can consume route segments without changing orchestration boundaries.
  • UI surfacing

    • Added a sidebar Route Card panel/table and rendering logic to display normalized rows (#, From, To, Direction, Distance, Total).
    • Kept existing path info behavior intact; route card hides when no rows are available.
const path = {
  coordinates,
  distance: route.distance,
  duration: route.duration,
  type: 'road',
  travelMode,
  routeCard: this.normalizeOSRMRouteToRouteCard(route, start, destination, travelMode, 'road')
};

Co-authored-by: PowerShellYoungTeam <53131013+PowerShellYoungTeam@users.noreply.github.com>
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.

2 participants