package mlgpx

  1. Overview
  2. Docs

Module Gpx.WaypointSource

GPS waypoint data and fix types

The Waypoint module handles individual GPS points, including waypoints, route points, and track points. Each waypoint contains:

  • Required coordinates (latitude/longitude)
  • Optional elevation in meters above mean sea level
  • Optional timestamp
  • Optional metadata like name, description, symbol
  • Optional GPS quality information (accuracy, satellite count, etc.)

Fix types indicate GPS quality: none, 2D, 3D, DGPS, or PPS.

Waypoint data and GPS fix types

Sourcetype fix_type =
  1. | None_fix
  2. | Fix_2d
  3. | Fix_3d
  4. | Dgps
  5. | Pps

GPS fix types as defined in GPX spec

Sourcetype t = {
  1. lat : Coordinate.latitude;
  2. lon : Coordinate.longitude;
  3. ele : float option;
  4. time : Ptime.t option;
  5. magvar : Coordinate.degrees option;
  6. geoidheight : float option;
  7. name : string option;
  8. cmt : string option;
  9. desc : string option;
  10. src : string option;
  11. sym : string option;
  12. type_ : string option;
  13. fix : fix_type option;
  14. sat : int option;
  15. hdop : float option;
  16. vdop : float option;
  17. pdop : float option;
  18. ageofdgpsdata : float option;
  19. dgpsid : int option;
  20. extensions : Extension.t list;
}

Main waypoint type - shared by waypoints, route points, track points

Fix Type Operations

Sourceval fix_type_to_string : fix_type -> string

Convert fix_type to string

Sourceval fix_type_of_string : string -> fix_type option

Parse fix_type from string

Sourceval compare_fix_type : fix_type -> fix_type -> int

Compare fix types

Sourceval pp_fix_type : Format.formatter -> fix_type -> unit

Pretty print fix type

Waypoint Operations

Create waypoint with required coordinates

Sourceval make_from_floats : lat:float -> lon:float -> ?name:string -> ?desc:string -> unit -> (t, string) result

Create waypoint from float coordinates with validation

Sourceval coordinate : t -> Coordinate.t

Get coordinate pair

Get latitude

Get longitude

Sourceval to_floats : t -> float * float

Get coordinate as float pair

Sourceval elevation : t -> float option

Get elevation

Sourceval time : t -> Ptime.t option

Get time

Sourceval name : t -> string option

Get name

Sourceval description : t -> string option

Get description

Sourceval comment : t -> string option

Get comment

Sourceval source : t -> string option

Get source

Sourceval symbol : t -> string option

Get symbol

Sourceval type_ : t -> string option

Get type

Sourceval fix : t -> fix_type option

Get fix type

Sourceval sat : t -> int option

Get satellite count

Sourceval hdop : t -> float option

Get horizontal dilution of precision

Sourceval vdop : t -> float option

Get vertical dilution of precision

Sourceval pdop : t -> float option

Get position dilution of precision

Sourceval magvar : t -> Coordinate.degrees option

Get magnetic variation

Sourceval geoidheight : t -> float option

Get geoid height

Sourceval ageofdgpsdata : t -> float option

Get age of DGPS data

Sourceval dgpsid : t -> int option

Get DGPS ID

Get links

Sourceval extensions : t -> Extension.t list

Get extensions

Functional operations for building waypoints

Sourceval with_elevation : t -> float -> t

Update elevation

Sourceval with_time : t -> Ptime.t option -> t

Update time

Sourceval with_name : t -> string -> t

Update name

Sourceval with_comment : t -> string -> t

Update comment

Sourceval with_description : t -> string -> t

Update description

Sourceval with_source : t -> string -> t

Update source

Sourceval with_symbol : t -> string -> t

Update symbol

Sourceval with_type : t -> string -> t

Update type

Sourceval with_fix : t -> fix_type option -> t

Update fix

Sourceval with_sat : t -> int -> t

Update satellite count

Sourceval with_hdop : t -> float -> t

Update HDOP

Sourceval with_vdop : t -> float -> t

Update VDOP

Sourceval with_pdop : t -> float -> t

Update PDOP

Sourceval with_magvar : t -> Coordinate.degrees -> t

Update magnetic variation

Sourceval with_geoidheight : t -> float -> t

Update geoid height

Sourceval with_ageofdgpsdata : t -> float -> t

Update age of DGPS data

Sourceval with_dgpsid : t -> int -> t

Update DGPS ID

Add link

Sourceval add_extensions : t -> Extension.t list -> t

Add extensions

Sourceval compare : t -> t -> int

Compare waypoints

Sourceval equal : t -> t -> bool

Test waypoint equality

Sourceval pp : Format.formatter -> t -> unit

Pretty print waypoint

OCaml

Innovation. Community. Security.