mlgpx.core
Track.Segment
mlgpx.eio
mlgpx.unix
type t = segment
val empty : t
Create empty segment
val make : point list -> t
Create segment with points
val make_from_coords : (float * float) list -> t
Create segment from coordinate list.
Invalid_argument
on invalid coordinates
val points : t -> point list
Get points
val point_count : t -> int
Get point count
val extensions : t -> Extension.t list
Get extensions
val add_point : t -> point -> t
Add point
val add_points : t -> point list -> t
Add points
val to_coords : t -> (float * float) list
Extract coordinates
val distance : t -> float
Calculate segment distance in meters
val is_empty : t -> bool
Check if empty
val first_point : t -> point option
First point
val last_point : t -> point option
Last point
val compare : t -> t -> int
Compare segments
val equal : t -> t -> bool
Test segment equality
val pp : Format.formatter -> t -> unit
Pretty print segment