feat(roadtrip): let a day drive along an imported track

An imported GPX track was a line drawn beside the day: the map showed the
scenic route while the day kept driving the motorway, so the distance, the
drive time and every warning belonged to a road nobody was taking. Norway
publishes its scenic routes that way, and so does every touring club worth
importing from.

A track becomes a route the day takes by refinement, not by conversion. Route
through what we have, find the point of the track the road misses by the most,
make that point a via, go again. Each round roughly halves the worst miss,
because the new via lands in the middle of what the last one left unfollowed,
so a scenic route usually fits inside ten vias — and the loop stops when the
road is close enough rather than after a fixed count. Every point of the track
would route exactly and take a hundred requests; two would route in seconds
and follow nothing.

The day is routed whole per round, not leg by leg: it is a single request
already, and per-leg would multiply every round by the number of legs against
a host that answers one request a second. The track is oriented to the day
first, because half of Norway's routes are published southbound, and the legs
it covers are cleared before the new chain lands, so applying a track twice
does not stack.

Offered from the day's own badges, and only once something has been imported.
Tinted while the day carries vias: the rail draws none of them, so that badge
is the only place a drive shaped by hand differs from one the router picked.
This commit is contained in:
Maurice
2026-09-05 00:22:44 +02:00
committed by Maurice
parent 620f4c6ecd
commit 761ec4e66f
35 changed files with 1807 additions and 3 deletions
+18
View File
@@ -46,6 +46,24 @@ const roadtrip: TranslationStrings = {
'roadtrip.poi.free': 'Gratuït',
'roadtrip.poi.wholeDay': 'Tot el dia',
'roadtrip.poi.midLeg': 'A mig cami, {from} a {to}',
'roadtrip.track.title': 'El dia {number} segueix una traça',
'roadtrip.track.hint': 'Fes que aquest dia segueixi una traça importada',
'roadtrip.track.badge': 'Traça',
'roadtrip.track.untitled': 'Traça sense nom',
'roadtrip.track.empty': 'No hi ha traces en aquest viatge',
'roadtrip.track.emptyHint': 'Importa un fitxer GPX o KML i les seves traces apareixeran aquí.',
'roadtrip.track.length': '{distance} de llarg',
'roadtrip.track.gap': 'a {distance} d’aquest dia',
'roadtrip.track.onDay': 'al llarg d’aquest dia',
'roadtrip.track.explain': 'El trajecte s’ajusta a la traça amb uns quants punts de pas. Els punts existents en aquests trams se substitueixen.',
'roadtrip.track.action': 'Segueix aquesta traça',
'roadtrip.track.working': 'Ajustant el trajecte a la traça, ronda {round}',
'roadtrip.track.done': 'S’han col·locat {count} punts de pas. El trajecte es manté a menys de {distance} de la traça.',
'roadtrip.track.capped': 'S’han col·locat {count} punts de pas. En el punt més ample, el trajecte queda a {distance} de la traça.',
'roadtrip.track.already': 'El trajecte ja seguia aquesta traça.',
'roadtrip.track.errorRoute': 'El servei de rutes no ha respost.',
'roadtrip.track.errorSave': 'No s’han pogut desar els punts de pas.',
'roadtrip.track.clear': 'Elimina {count} punts de pas',
'roadtrip.poi.rest': 'Àrea de descans',
'roadtrip.poi.campsite': 'Càmping',
'roadtrip.poi.food': 'Menjar',