feat(roadtrip): narrow the corridor to one stretch of the drive

A seven-hundred-kilometre day turns up seventy hits spread over the whole of
it, and the traveller wanting a break near Berlin has to read all seventy and
work out from "245 km along the route" which ones are anywhere near. That is
the wrong way round: you decide roughly where to stop, and then look at what is
there.

Picking a point narrows the list to what lies within 25, 50 or 100 km of it.
This is a subtraction rather than a second search, because the stops and the
hits are already measured along the same thinned line.

The midpoints of the legs are offered alongside the stops, and they are the
point of the feature: a break on a five-hour drive belongs in the middle of the
drive, not at either end. Asking only about stops would answer "what is near
Berlin" when the question is "what is near the halfway mark".

The chosen point is stored as which anchor it is rather than as a distance.
alongKm is measured against a line thinned with a tolerance derived from the
corridor width, so a kilometre figure kept here would quietly drift when the
width goes from 5 to 10; resolved through the stops it lands on the same place
again. It also names its day, so switching days cannot apply yesterday's break
to today's drive.
This commit is contained in:
Maurice
2026-09-04 23:44:16 +02:00
committed by Maurice
parent 061259b3d9
commit 36ac5de84c
29 changed files with 254 additions and 33 deletions
+2
View File
@@ -44,6 +44,8 @@ const roadtrip: TranslationStrings = {
'roadtrip.poi.anySocket': 'أي قابس',
'roadtrip.poi.anyPower': 'أي قدرة',
'roadtrip.poi.free': 'مجاني',
'roadtrip.poi.wholeDay': 'اليوم كله',
'roadtrip.poi.midLeg': 'في المنتصف، {from} إلى {to}',
'roadtrip.poi.rest': 'استراحة',
'roadtrip.poi.campsite': 'مخيم',
'roadtrip.poi.food': 'طعام',