Skip to content

Route statistics#439

Merged
karussell merged 44 commits intomasterfrom
route_stats
Mar 11, 2026
Merged

Route statistics#439
karussell merged 44 commits intomasterfrom
route_stats

Conversation

@karussell
Copy link
Member

@karussell karussell commented Feb 28, 2026

More insights into routes, especially bike routes is very valuable.

Especially when tuning them. And so I always wanted to create some statistic overview per route. And as this is not only useful for developers but also for users I thought I would integrate it directly in GH Maps (click "Details").

Try it here.

image

level of traffic stress (see here and here and here):

rule number Condition LTS
1 cycleway: track, separate 1
2 road_class: cycleway, path, footway, pedestrian, living_street, bridleway, track, corridor 1
3 road_class: service 2
4 road_class: steps 3
5 road_class: trunk, motorway 4
6 road_class: primary, secondary + lane 3
7 road_class: primary, secondary + missing + non-rural 3
8 road_class: primary, secondary (otherwise) 4
9 road_class: tertiary + lane + non-rural 2
10 road_class: tertiary (otherwise) 3
11 road_class: residential 2
12 unclassified + rural 3
13 fallback (unclassified non-rural, other) 2

note: table is updated when tweaks happen in master. they should reference to this PR
important note: crossing roads is currently not considered!!

Open questions:

  • Should tertiary + cycleway === 'missing' go to LTS 2 instead of 3? Same for primary/secondary and cycleway==missing
  • trunk/motorway is always LTS 4 even with cycleway === 'track'. For now probably fine to be ignored as it is rare.
  • cycleway === 'no' on primary/secondary is LTS 3 in cities (not according to Furth)

and for foot:

rule number Condition LTS
1 sidewalk: yes, separate 1
2 road_class: footway, pedestrian, path, living_street, steps, bridleway, corridor, track, cycleway, service 1
3 road_class: trunk, motorway 4
4 road_class: primary, secondary + missing + non-rural 3
5 road_class: primary, secondary (otherwise) 4
6 road_class: tertiary + rural 4
7 road_class: tertiary + non-rural 3
8 road_class: residential 2
9 unclassified + rural 3
10 fallback (unclassified non-rural, other) 2

TODO

  • adapt color in heightgraph (Elevation widget #440)
  • separate incline + decline (for now keep it simple and combined)
  • add cycleway & footway as path details (see here and here)
  • use cycleway & footway path details for bike/foot stress level calculation instead of road class alone

karussell and others added 12 commits February 27, 2026 21:54
Lift isExpanded state from RoutingResult to parent RoutingResults
component so it survives when child components re-mount after adding
via points or recalculating routes. Also use stable path-derived keys
instead of array indices for React reconciliation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@karussell karussell added the enhancement New feature or request label Feb 28, 2026
@ratrun
Copy link
Contributor

ratrun commented Feb 28, 2026

This is awesome! 🎂

@ratrun
Copy link
Contributor

ratrun commented Feb 28, 2026

Just one minor thing to make it production ready:

Bildschirmfoto vom 2026-02-28 14-32-22

Would it be possible to use the same colors in the left statistics and in the Legend? It seems the statistics colors are manually tuned, so these should also be used in the Legend.

karussell and others added 12 commits March 4, 2026 13:43
Mostly micro-optimizations:
- ElevationInfoBar: throttle hover dispatches to once per animation frame
- ChartRenderer: skip resize when dimensions unchanged
- ElevationWidget: floor fractional ResizeObserver widths; add touch handlers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Return same state reference in PathDetailsStore when SetActiveDetail
dispatches the same detail. Without this, the spread operator creates a
new object every time, which passes Store's reference equality check and
triggers a re-render loop.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@karussell karussell added this to the 0.9 milestone Mar 5, 2026
@karussell karussell merged commit 103e606 into master Mar 11, 2026
2 checks passed
@karussell karussell deleted the route_stats branch March 11, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants