downsample

fun downsample(fixes: List<Fix>, targetIntervalSec: Double): List<Fix>

Thin fixes so consecutive kept points are at least targetIntervalSec apart, without moving or dropping the first or last fix.

Endpoints are preserved unconditionally because they anchor every downstream distance comparison — a trip whose downsampled trace starts or ends somewhere other than where the recorded trip actually started or ended would make every reconciliation against a client figure meaningless before the matcher is even called.

ponytail: a simple time gate, not a Douglas-Peucker-style geometric simplifier. A geometric simplifier optimizes for shape fidelity; what a map matcher needs is a sane number of points per unit time. Revisit only if OSRM keeps fragmenting matches on a gated trace.