Track data with segments
The Track module handles recorded GPS traces, typically representing actual journeys. Tracks are divided into segments to handle GPS interruptions:
- Track segments contain ordered track points
- Each track point is a timestamped waypoint
- Multiple segments per track handle GPS signal loss
- Distance and time calculations available
Track types and operations
Track point is an alias for waypoint
Sourcetype t = {name : string option;cmt : string option;desc : string option;src : string option;links : Link.t list;number : int option;type_ : string option;extensions : Extension.t list;trksegs : segment list;
} Track Segment Operations
Track Constructors
Sourceval make_from_coords : name:string -> (float * float) list -> t Create track from coordinate list (single segment).
Track Properties
Sourceval name : t -> string option Sourceval description : t -> string option Sourceval source : t -> string option Sourceval type_ : t -> string option Get total point count across all segments
Track Modification
Track Analysis
Sourceval to_coords : t -> (float * float) list Extract all coordinates from track
Sourceval total_distance : t -> float Calculate total track distance across all segments in meters
Get all points from all segments
Get first point from first segment
Get last point from last segment
Comparison and Utilities
Functional Operations
Sourceval with_description : t -> string -> t Sourceval with_source : t -> string -> t