MatchReconciliation
Decide what to present when the client's own distance and a map-matched distance disagree.
A map match is a correction, not a replacement — the client figure was computed from fixes the app actually recorded and trusted enough to persist, so it is never simply thrown away. This is the one place that decides whether the matched figure has earned the right to override it, and the decision is explicit and testable rather than "whichever number happened to render".
Two ways a match must NOT override, both drawn from confirmed OSRM behaviour:
Low confidence. Confidence collapses toward zero on a sparse trace — a real 3-point match returned
5.9e-05. A number that low is not "worse evidence", it is the provider saying it barely fit anything at all.Wild disagreement even at high confidence. A dense trace can fragment into several disconnected matchings, or the vehicle may have driven somewhere the road graph does not model well. A confidently-reported figure that is nowhere near the client's is more likely a bad fit than a large bias correction, so it is flagged for review rather than trusted blindly.