package mlgpx

  1. Overview
  2. Docs

Module Gpx.DocSource

Main GPX document type

The Doc module represents complete GPX documents containing:

  • Document metadata (creator, version)
  • Collections of waypoints, routes, and tracks
  • Document-level extensions
  • Statistics and analysis functions

Main GPX document type

Sourcetype t = {
  1. version : string;
  2. creator : string;
  3. metadata : Metadata.t option;
  4. waypoints : Waypoint.t list;
  5. routes : Route.t list;
  6. tracks : Track.t list;
  7. extensions : Extension.t list;
}

Main GPX document type

Sourcetype stats = {
  1. waypoint_count : int;
  2. route_count : int;
  3. track_count : int;
  4. total_points : int;
  5. has_elevation : bool;
  6. has_time : bool;
}

Document statistics

Document Constructors

Sourceval empty : creator:string -> t

Create empty GPX document

Sourceval make : creator:string -> metadata:Metadata.t -> t

Create GPX document with metadata

Document Properties

Sourceval version : t -> string

Get version

Sourceval creator : t -> string

Get creator

Sourceval metadata : t -> Metadata.t option

Get metadata

Sourceval waypoints : t -> Waypoint.t list

Get waypoints

Sourceval routes : t -> Route.t list

Get routes

Sourceval tracks : t -> Track.t list

Get tracks

Sourceval extensions : t -> Extension.t list

Get extensions

Document Modification

Sourceval with_metadata : t -> Metadata.t -> t

Update metadata

Sourceval add_waypoint : t -> Waypoint.t -> t

Add waypoint

Sourceval add_waypoints : t -> Waypoint.t list -> t

Add waypoints

Sourceval add_route : t -> Route.t -> t

Add route

Sourceval add_routes : t -> Route.t list -> t

Add routes

Sourceval add_track : t -> Track.t -> t

Add track

Sourceval add_tracks : t -> Track.t list -> t

Add tracks

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

Add extensions

Sourceval clear_waypoints : t -> t

Clear waypoints

Sourceval clear_routes : t -> t

Clear routes

Sourceval clear_tracks : t -> t

Clear tracks

Document Analysis

Sourceval waypoint_count : t -> int

Count waypoints

Sourceval route_count : t -> int

Count routes

Sourceval track_count : t -> int

Count tracks

Sourceval total_points : t -> int

Count total points

Sourceval has_elevation : t -> bool

Check if document has elevation data

Sourceval has_time : t -> bool

Check if document has time data

Sourceval is_empty : t -> bool

Check if document is empty

Sourceval stats : t -> stats

Get document statistics

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

Pretty print statistics

Comparison and Utilities

Sourceval compare : t -> t -> int

Compare documents

Sourceval equal : t -> t -> bool

Test document equality

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

Pretty print document

OCaml

Innovation. Community. Security.