(** Waypoint data and GPS fix types *) (** GPS fix types as defined in GPX spec *) type fix_type = | None_fix | Fix_2d | Fix_3d | Dgps | Pps (** Main waypoint type - shared by waypoints, route points, track points *) type t = { lat : Coordinate.latitude; lon : Coordinate.longitude; ele : float option; time : Ptime.t option; magvar : Coordinate.degrees option; geoidheight : float option; name : string option; cmt : string option; desc : string option; src : string option; links : Link.t list; sym : string option; type_ : string option; fix : fix_type option; sat : int option; hdop : float option; vdop : float option; pdop : float option; ageofdgpsdata : float option; dgpsid : int option; extensions : Extension.t list; } (** {2 Fix Type Operations} *) (** Convert fix_type to string *) val fix_type_to_string : fix_type -> string (** Parse fix_type from string *) val fix_type_of_string : string -> fix_type option (** Compare fix types *) val compare_fix_type : fix_type -> fix_type -> int (** Pretty print fix type *) val pp_fix_type : Format.formatter -> fix_type -> unit (** {2 Waypoint Operations} *) (** Create waypoint with required coordinates *) val make : Coordinate.latitude -> Coordinate.longitude -> t (** Create waypoint from float coordinates with validation *) val make_from_floats : lat:float -> lon:float -> ?name:string -> ?desc:string -> unit -> (t, string) result (** Get coordinate pair *) val coordinate : t -> Coordinate.t (** Get latitude *) val lat : t -> Coordinate.latitude (** Get longitude *) val lon : t -> Coordinate.longitude (** Get coordinate as float pair *) val to_floats : t -> float * float (** Get elevation *) val elevation : t -> float option (** Get time *) val time : t -> Ptime.t option (** Get name *) val name : t -> string option (** Get description *) val description : t -> string option (** Get comment *) val comment : t -> string option (** Get source *) val source : t -> string option (** Get symbol *) val symbol : t -> string option (** Get type *) val type_ : t -> string option (** Get fix type *) val fix : t -> fix_type option (** Get satellite count *) val sat : t -> int option (** Get horizontal dilution of precision *) val hdop : t -> float option (** Get vertical dilution of precision *) val vdop : t -> float option (** Get position dilution of precision *) val pdop : t -> float option (** Get magnetic variation *) val magvar : t -> Coordinate.degrees option (** Get geoid height *) val geoidheight : t -> float option (** Get age of DGPS data *) val ageofdgpsdata : t -> float option (** Get DGPS ID *) val dgpsid : t -> int option (** Get links *) val links : t -> Link.t list (** Get extensions *) val extensions : t -> Extension.t list (** Functional operations for building waypoints *) (** Update elevation *) val with_elevation : t -> float -> t (** Update time *) val with_time : t -> Ptime.t option -> t (** Update name *) val with_name : t -> string -> t (** Update comment *) val with_comment : t -> string -> t (** Update description *) val with_description : t -> string -> t (** Update source *) val with_source : t -> string -> t (** Update symbol *) val with_symbol : t -> string -> t (** Update type *) val with_type : t -> string -> t (** Update fix *) val with_fix : t -> fix_type option -> t (** Update satellite count *) val with_sat : t -> int -> t (** Update HDOP *) val with_hdop : t -> float -> t (** Update VDOP *) val with_vdop : t -> float -> t (** Update PDOP *) val with_pdop : t -> float -> t (** Update magnetic variation *) val with_magvar : t -> Coordinate.degrees -> t (** Update geoid height *) val with_geoidheight : t -> float -> t (** Update age of DGPS data *) val with_ageofdgpsdata : t -> float -> t (** Update DGPS ID *) val with_dgpsid : t -> int -> t (** Add link *) val add_link : t -> Link.t -> t (** Add extensions *) val add_extensions : t -> Extension.t list -> t (** Compare waypoints *) val compare : t -> t -> int (** Test waypoint equality *) val equal : t -> t -> bool (** Pretty print waypoint *) val pp : Format.formatter -> t -> unit