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