TracePreparation

Functions

Link copied to clipboard
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.

Link copied to clipboard
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.

Link copied to clipboard

Recombine one MatchedRoute per chunks entry into a single trip distance, counting the overlap between consecutive chunks exactly once.