chunk

fun chunk(fixes: List<Fix>, maxPointsPerChunk: Int, overlapPoints: Int): List<TraceChunk>

Split fixes into request-sized windows, each sharing up to overlapPoints points with the previous window.

TraceChunk.overlapWithPrevious tells the caller — and stitchMatchedDistanceM — exactly how many of a chunk's leading points are a rerun of the previous chunk's trailing points, so nothing downstream has to re-derive it from timestamps.