Re-add speed limit color mode with BRouter profile patch

The dummyUsage trick needs a separate assign per tag:
  assign dummyUsage2 = maxspeed=
(not appended to the existing smoothness= line)

- Dockerfile: Patch all BRouter profiles to include maxspeed in
  WayTags output via separate assign dummyUsage2
- brouter.ts: Extract maxspeed with direction handling
  (maxspeed:forward/backward + reversedirection awareness)
- ColoredRoute: maxspeed color mode (green ≤30, yellow ≤50,
  orange ≤70, red ≤100, dark red 100+)
- ElevationChart: maxspeed chart rendering, legend, hover "X km/h"
- PlannerMap: maxspeeds state + Yjs read + prop passing
- i18n: EN "Speed Limit" / DE "Tempolimit"
- Mock fixtures: maxspeed data for E2E tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ullrich Schäfer 2026-04-11 09:44:40 +02:00
parent cec613d989
commit 61d34821df
No known key found for this signature in database
GPG key ID: A32FF691A0F752D9
9 changed files with 139 additions and 9 deletions

View file

@ -20,6 +20,16 @@ RUN addgroup --system app && adduser --system --ingroup app app \
RUN cp -r profiles2/* /data/profiles/ 2>/dev/null || true \
&& mv brouter-*-all.jar brouter.jar
# Patch profiles to include maxspeed in WayTags output (for speed limit visualization)
# Each tag needs its own assign statement to appear in tiledesc WayTags
RUN for f in /data/profiles/*.brf; do \
if grep -q "dummyUsage" "$f" && ! grep -q "maxspeed" "$f"; then \
sed -i '/assign dummyUsage/a assign dummyUsage2 = maxspeed=' "$f"; \
elif ! grep -q "maxspeed" "$f" && grep -q "context:node" "$f"; then \
sed -i '/---context:node/i assign dummyUsage2 = maxspeed=' "$f"; \
fi; \
done
USER app
EXPOSE 17777