mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
36ac5de84c
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.