(** Main GPX document type *) (** Main GPX document type *) type t = { version : string; (* GPX version: "1.0" or "1.1" *) creator : string; (* Creating application *) metadata : Metadata.t option; (* Document metadata *) waypoints : Waypoint.t list; (* Waypoints *) routes : Route.t list; (* Routes *) tracks : Track.t list; (* Tracks *) extensions : Extension.t list; (* Document-level extensions *) } (** Document statistics *) type stats = { waypoint_count : int; route_count : int; track_count : int; total_points : int; has_elevation : bool; has_time : bool; } (** {2 Document Constructors} *) (** Create empty GPX document *) val empty : creator:string -> t (** Create GPX document with metadata *) val make : creator:string -> metadata:Metadata.t -> t (** {2 Document Properties} *) (** Get version *) val version : t -> string (** Get creator *) val creator : t -> string (** Get metadata *) val metadata : t -> Metadata.t option (** Get waypoints *) val waypoints : t -> Waypoint.t list (** Get routes *) val routes : t -> Route.t list (** Get tracks *) val tracks : t -> Track.t list (** Get extensions *) val extensions : t -> Extension.t list (** {2 Document Modification} *) (** Update metadata *) val with_metadata : t -> Metadata.t -> t (** Add waypoint *) val add_waypoint : t -> Waypoint.t -> t (** Add waypoints *) val add_waypoints : t -> Waypoint.t list -> t (** Add route *) val add_route : t -> Route.t -> t (** Add routes *) val add_routes : t -> Route.t list -> t (** Add track *) val add_track : t -> Track.t -> t (** Add tracks *) val add_tracks : t -> Track.t list -> t (** Add extensions *) val add_extensions : t -> Extension.t list -> t (** Clear waypoints *) val clear_waypoints : t -> t (** Clear routes *) val clear_routes : t -> t (** Clear tracks *) val clear_tracks : t -> t (** {2 Document Analysis} *) (** Count waypoints *) val waypoint_count : t -> int (** Count routes *) val route_count : t -> int (** Count tracks *) val track_count : t -> int (** Count total points *) val total_points : t -> int (** Check if document has elevation data *) val has_elevation : t -> bool (** Check if document has time data *) val has_time : t -> bool (** Check if document is empty *) val is_empty : t -> bool (** Get document statistics *) val stats : t -> stats (** Pretty print statistics *) val pp_stats : Format.formatter -> t -> unit (** {2 Comparison and Utilities} *) (** Compare documents *) val compare : t -> t -> int (** Test document equality *) val equal : t -> t -> bool (** Pretty print document *) val pp : Format.formatter -> t -> unit