GPS Exchange Format library/CLI in OCaml
1(** High-level Unix API for GPX operations *)
2
3(* Re-export IO module *)
4module IO = Gpx_io
5
6(* Re-export common types *)
7open Gpx
8
9(** Convenience functions for common operations *)
10
11(** Read and parse GPX file *)
12val read : ?validate:bool -> string -> (t, error) result
13
14(** Write GPX to file *)
15val write : ?validate:bool -> string -> t -> (unit, error) result
16
17(** Write GPX to file with backup *)
18val write_with_backup : ?validate:bool -> string -> t -> (string, error) result
19
20(** Convert GPX to string *)
21val to_string : ?validate:bool -> t -> (string, error) result
22
23(** Parse GPX from string *)
24val from_string : ?validate:bool -> string -> (t, error) result
25
26(** Quick validation check *)
27val is_valid : t -> bool
28
29(** Get validation issues *)
30val validate : t -> validation_result
31
32(** Create simple waypoint *)
33val make_waypoint : lat:float -> lon:float -> ?name:string -> ?desc:string -> unit -> (Waypoint.t, error) result
34
35(** Create simple track from coordinate list *)
36val make_track_from_coords : name:string -> (float * float) list -> (Track.t, error) result
37
38(** Create simple route from coordinate list *)
39val make_route_from_coords : name:string -> (float * float) list -> (Route.t, error) result
40
41(** Extract coordinates from waypoints *)
42val waypoint_coords : Waypoint.t -> float * float
43
44(** Extract coordinates from track *)
45val track_coords : Track.t -> (float * float) list
46
47(** Extract coordinates from route *)
48val route_coords : Route.t -> (float * float) list
49
50(** Count total points in GPX *)
51val count_points : t -> int
52
53(** GPX statistics *)
54type gpx_stats = {
55 waypoint_count : int;
56 route_count : int;
57 track_count : int;
58 total_points : int;
59 has_elevation : bool;
60 has_time : bool;
61}
62
63(** Get GPX statistics *)
64val stats : t -> gpx_stats
65
66(** Pretty print GPX statistics *)
67val print_stats : t -> unit