Commit 9338525
committed
Add curve-aware speed analysis for rail paths
Closes #128
Implement curve radius analysis for rail transit paths
(tram, metro, rail, monorail, etc.) that estimates speed limits imposed
by track curvature and adjusts travel times accordingly
when geometry is precise enough.
transition-backend:
- Add railCurves/ module with geometry analysis
(radius estimation via inscribed circle method),
curvature segmentation, speed profile generation (forward-backward pass
with acceleration/deceleration), and segment travel time calculation
- Add transitPaths.curveAnalysis socket API endpoint for on-demand
curve analysis from the frontend
- Add transitPathCurves.socketRoutes.test.ts with 14 tests covering
edge cases, multi-segment paths, all rail modes, large angle detection,
dwell time impact, and speed impact
- Register new socket route in all.socketRoutes.ts
transition-common:
- Add railCurves/types.ts to transition-common (shared types)
- Add geometry resolution detection (high/low/none/almostStraight) to
skip curve analysis when path shapes are too coarse
transition-frontend:
- Add CurveStatsPanel with interactive speed profile chart (Recharts)
supporting time and distance X-axis modes, proportional chart width,
and configurable tick intervals
- Add CurveStatsTable for per-segment travel time breakdown
- Add map layers for curve segments (orange) and large-angle vertices
(orange circles) to help users identify imprecise path geometry
- Update TransitPathEdit to fetch curve analysis from backend API,
auto-refresh on geometry changes (waypoint drag, node add/remove,
undo/redo), and show progress notification during calculation
- Apply curve-aware travel times to path data (operatingTime, speeds)
so schedules and saved paths use curve-adjusted values
- Add pathStale warning when parameters or geometry change, cleared
after route recalculation
- Update TransitPathStatistics to show curve-aware travel times for
rail modes, hiding curve comparison when geometry is not high-res
- Add styles for curve stats panel, table, chart, and toggle controls
Locales:
- Add English and French translations for all new curve analysis UI
strings, warnings, labels, and progress notifications
New package:
- recharts for curve stats panel chart1 parent b937403 commit 9338525
File tree
31 files changed
+5794
-210
lines changed- locales
- en
- fr
- packages
- transition-backend/src
- api
- __tests__
- services/path
- __tests__
- railCurves
- transition-common/src/services
- line
- path
- __tests__
- railCurves
- transition-frontend
- src
- components
- dashboard
- forms/path
- map
- config
- styles
31 files changed
+5794
-210
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
307 | 308 | | |
308 | 309 | | |
309 | 310 | | |
310 | | - | |
| 311 | + | |
| 312 | + | |
311 | 313 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
| 468 | + | |
| 469 | + | |
468 | 470 | | |
469 | 471 | | |
470 | 472 | | |
| |||
513 | 515 | | |
514 | 516 | | |
515 | 517 | | |
516 | | - | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
517 | 554 | | |
518 | 555 | | |
519 | 556 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
307 | 308 | | |
308 | 309 | | |
309 | 310 | | |
310 | | - | |
| 311 | + | |
| 312 | + | |
311 | 313 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
| 468 | + | |
| 469 | + | |
468 | 470 | | |
469 | 471 | | |
470 | 472 | | |
| |||
513 | 515 | | |
514 | 516 | | |
515 | 517 | | |
516 | | - | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
517 | 554 | | |
518 | 555 | | |
519 | 556 | | |
| |||
0 commit comments