+35
-6
.tangled/workflows/build.yml
+35
-6
.tangled/workflows/build.yml
···
+1
-1
CHANGES.md
+1
-1
CHANGES.md
+2
-4
README.md
+2
-4
README.md
·········
·········
+1
-1
bin/dune
+1
-1
bin/dune
+73
-89
bin/mlgpx_cli.ml
+73
-89
bin/mlgpx_cli.ml
·········-let total_points = List.fold_left (fun acc seg -> acc + List.length seg.trkpts) 0 track_segments in···Fmt.pf Format.std_formatter "%a\n" (success_style Fmt.string) "Conversion completed successfully!";···············-let waypoints_with_time = List.filter (fun (wpt : waypoint) -> wpt.time <> None) gpx.waypoints in-let waypoints_with_elevation = List.filter (fun (wpt : waypoint) -> wpt.ele <> None) gpx.waypoints in-let total_points = List.fold_left (fun acc seg -> acc + List.length seg.trkpts) 0 track.trksegs in···
·········+let total_points = List.fold_left (fun acc seg -> acc + Track.Segment.point_count seg) 0 track_segments in···Fmt.pf Format.std_formatter "%a\n" (success_style Fmt.string) "Conversion completed successfully!";·········+Printf.printf " Description: %s\n" (Option.value (Metadata.description meta) ~default:"<none>");······+let waypoints_with_time = List.filter (fun wpt -> Waypoint.time wpt <> None) (Doc.waypoints gpx) in+let waypoints_with_elevation = List.filter (fun wpt -> Waypoint.elevation wpt <> None) (Doc.waypoints gpx) in···
+5
-1
dune-project
+5
-1
dune-project
···"mlgpx is a streaming GPX (GPS Exchange Format) library for OCaml. It provides a portable core library using the xmlm streaming XML parser, with a separate Unix layer for file I/O operations. The library supports the complete GPX 1.1 specification including waypoints, routes, tracks, and metadata with strong type safety and validation.")
···"mlgpx is a streaming GPX (GPS Exchange Format) library for OCaml. It provides a portable core library using the xmlm streaming XML parser, with a separate Unix layer for file I/O operations. The library supports the complete GPX 1.1 specification including waypoints, routes, tracks, and metadata with strong type safety and validation.")
+1
-7
examples/dune
+1
-7
examples/dune
-88
examples/effects_example.ml
-88
examples/effects_example.ml
···-let waypoint1 = make_waypoint ~fs ~lat:(Gpx.latitude_to_float lat1) ~lon:(Gpx.longitude_to_float lon1) ~name:"San Francisco" () in-let waypoint2 = make_waypoint ~fs ~lat:(Gpx.latitude_to_float lat2) ~lon:(Gpx.longitude_to_float lon2) ~name:"Near SF" () in
···
+87
-104
examples/simple_gpx.ml
+87
-104
examples/simple_gpx.ml
···
···+Printf.printf "✓ Created waypoint: %s\n" (Option.value (Waypoint.name wpt) ~default:"<unnamed>");+let metadata = { metadata with name = Some "Example GPX File"; desc = Some "Demonstration of mlgpx library capabilities" } in+let track = { track with cmt = Some "Sample GPS track"; desc = Some "Demonstrates track creation" } in
+59
lib/gpx/coordinate.ml
+59
lib/gpx/coordinate.ml
···
···
+68
lib/gpx/coordinate.mli
+68
lib/gpx/coordinate.mli
···
···
+186
lib/gpx/doc.ml
+186
lib/gpx/doc.ml
···
···+Format.fprintf ppf "@[<v>GPX Statistics:@, Waypoints: %d@, Routes: %d@, Tracks: %d@, Total points: %d@, Has elevation data: %s@, Has time data: %s@]"
+128
lib/gpx/doc.mli
+128
lib/gpx/doc.mli
···
···
+14
-1
lib/gpx/dune
+14
-1
lib/gpx/dune
+111
lib/gpx/error.ml
+111
lib/gpx/error.ml
···
···
+85
lib/gpx/error.mli
+85
lib/gpx/error.mli
···
···
+144
lib/gpx/extension.ml
+144
lib/gpx/extension.ml
···
···
+87
lib/gpx/extension.mli
+87
lib/gpx/extension.mli
···
···+val make : ?namespace:string -> name:string -> attributes:(string * string) list -> content:content -> unit -> t+val make_text : name:string -> ?namespace:string -> ?attributes:(string * string) list -> string -> t+val make_elements : name:string -> ?namespace:string -> ?attributes:(string * string) list -> t list -> t+val make_mixed : name:string -> ?namespace:string -> ?attributes:(string * string) list -> string -> t list -> t
+86
-56
lib/gpx/gpx.ml
+86
-56
lib/gpx/gpx.ml
···-type person = Types.person = { name : string option; email : string option; link : link option }-type copyright = Types.copyright = { author : string; year : int option; license : string option }-type bounds = Types.bounds = { minlat : latitude; minlon : longitude; maxlat : latitude; maxlon : longitude }-type extension_content = Types.extension_content = Text of string | Elements of extension list | Mixed of string * extension list-and extension = Types.extension = { namespace : string option; name : string; attributes : (string * string) list; content : extension_content }-type metadata = Types.metadata = { name : string option; desc : string option; author : person option; copyright : copyright option; links : link list; time : Ptime.t option; keywords : string option; bounds : bounds option; extensions : extension list }-type waypoint_data = Types.waypoint_data = { lat : latitude; lon : longitude; ele : float option; time : Ptime.t option; magvar : degrees option; geoidheight : float option; name : string option; cmt : string option; desc : string option; src : string option; links : link list; sym : string option; type_ : string option; fix : fix_type option; sat : int option; hdop : float option; vdop : float option; pdop : float option; ageofdgpsdata : float option; dgpsid : int option; extensions : extension list }-type route = Types.route = { name : string option; cmt : string option; desc : string option; src : string option; links : link list; number : int option; type_ : string option; extensions : extension list; rtepts : route_point list }-type track_segment = Types.track_segment = { trkpts : track_point list; extensions : extension list }-type track = Types.track = { name : string option; cmt : string option; desc : string option; src : string option; links : link list; number : int option; type_ : string option; extensions : extension list; trksegs : track_segment list }-type gpx = Types.gpx = { version : string; creator : string; metadata : metadata option; waypoints : waypoint list; routes : route list; tracks : track list; extensions : extension list }-type error = Types.error = Invalid_xml of string | Invalid_coordinate of string | Missing_required_attribute of string * string | Missing_required_element of string | Validation_error of string | Xml_error of string | IO_error of string-type validation_issue = Validate.validation_issue = { level : [`Error | `Warning]; message : string; location : string option }-type validation_result = Validate.validation_result = { issues : validation_issue list; is_valid : bool }
···
+462
-317
lib/gpx/gpx.mli
+462
-317
lib/gpx/gpx.mli
···
···+files, strings, or other input sources using the {{:https://erratique.ch/software/xmlm}Xmlm} library.+level : [`Error | `Warning]; (** [`Error] for specification violations, [`Warning] for best practice issues *)+location : string option; (** Optional location context (e.g., "waypoint 1", "track segment 2") *)
+126
lib/gpx/link.ml
+126
lib/gpx/link.ml
···
···
+101
lib/gpx/link.mli
+101
lib/gpx/link.mli
···
···
+183
lib/gpx/metadata.ml
+183
lib/gpx/metadata.ml
···
···+let lat_diff = Coordinate.latitude_to_float t.maxlat -. Coordinate.latitude_to_float t.minlat in+let lon_diff = Coordinate.longitude_to_float t.maxlon -. Coordinate.longitude_to_float t.minlon in
+132
lib/gpx/metadata.mli
+132
lib/gpx/metadata.mli
···
···+val make_from_floats : minlat:float -> minlon:float -> maxlat:float -> maxlon:float -> (t, string) result+val bounds : t -> (Coordinate.latitude * Coordinate.longitude * Coordinate.latitude * Coordinate.longitude)
+226
-106
lib/gpx/parser.ml
+226
-106
lib/gpx/parser.ml
·························································
······························+Error (Error.validation_error ("Unsupported GPX version: " ^ version ^ " (supported: 1.0, 1.1)"))·········+(match Metadata.Bounds.make_from_floats ~minlat:minlat_f ~minlon:minlon_f ~maxlat:maxlat_f ~maxlon:maxlon_f with··················
+2
-4
lib/gpx/parser.mli
+2
-4
lib/gpx/parser.mli
+166
lib/gpx/route.ml
+166
lib/gpx/route.ml
···
···
+125
lib/gpx/route.mli
+125
lib/gpx/route.mli
···
···
+226
lib/gpx/track.ml
+226
lib/gpx/track.ml
···
···
+192
lib/gpx/track.mli
+192
lib/gpx/track.mli
···
···
-228
lib/gpx/types.ml
-228
lib/gpx/types.ml
···
···
-190
lib/gpx/types.mli
-190
lib/gpx/types.mli
···
···
+40
-33
lib/gpx/validate.ml
+40
-33
lib/gpx/validate.ml
·································
·································
+4
-6
lib/gpx/validate.mli
+4
-6
lib/gpx/validate.mli
······
······
+246
lib/gpx/waypoint.ml
+246
lib/gpx/waypoint.ml
···
···
+193
lib/gpx/waypoint.mli
+193
lib/gpx/waypoint.mli
···
···+val make_from_floats : lat:float -> lon:float -> ?name:string -> ?desc:string -> unit -> (t, string) result
+265
-294
lib/gpx/writer.ml
+265
-294
lib/gpx/writer.ml
······-(("http://www.w3.org/2001/XMLSchema-instance", "schemaLocation"), "http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd");
······+| Some degrees -> output_text_element writer name (Printf.sprintf "%.6f" (Coordinate.degrees_to_float degrees))+let* () = output_optional_float_element writer "geoidheight" (Waypoint.geoidheight waypoint) in+let* () = output_optional_float_element writer "ageofdgpsdata" (Waypoint.ageofdgpsdata waypoint) in+(("", "xsi:schemaLocation"), "http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd");
+2
-4
lib/gpx/writer.mli
+2
-4
lib/gpx/writer.mli
···
+1
-1
lib/gpx_eio/dune
+1
-1
lib/gpx_eio/dune
+11
-141
lib/gpx_eio/gpx_eio.ml
+11
-141
lib/gpx_eio/gpx_eio.ml
···
···+let write_with_backup ?(validate=false) ~fs path gpx = IO.write_file_with_backup ~validate ~fs path gpx
+23
-115
lib/gpx_eio/gpx_eio.mli
+23
-115
lib/gpx_eio/gpx_eio.mli
······-let wpt = make_waypoint fs ~lat:(Gpx.latitude_to_float lat) ~lon:(Gpx.longitude_to_float lon) ~name:"San Francisco" () in······-val make_waypoint : fs:[> Eio.Fs.dir_ty ] Eio.Path.t -> lat:float -> lon:float -> ?name:string -> ?desc:string -> unit -> Gpx.waypoint_data-val make_track_from_coords : fs:[> Eio.Fs.dir_ty ] Eio.Path.t -> name:string -> (float * float) list -> Gpx.track-val make_route_from_coords : fs:[> Eio.Fs.dir_ty ] Eio.Path.t -> name:string -> (float * float) list -> Gpx.route
·········+val write_with_backup : ?validate:bool -> fs:[> Eio.Fs.dir_ty ] Eio.Path.t -> string -> Gpx.t -> string···
+12
-56
lib/gpx_eio/gpx_io.ml
+12
-56
lib/gpx_eio/gpx_io.ml
············
············
+11
-34
lib/gpx_eio/gpx_io.mli
+11
-34
lib/gpx_eio/gpx_io.mli
·········
·········+val write_file_with_backup : ?validate:bool -> fs:[> Eio.Fs.dir_ty ] Eio.Path.t -> string -> Gpx.t -> string
+1
-1
lib/gpx_unix/dune
+1
-1
lib/gpx_unix/dune
+18
-41
lib/gpx_unix/gpx_io.ml
+18
-41
lib/gpx_unix/gpx_io.ml
·········
·········
+8
-14
lib/gpx_unix/gpx_io.mli
+8
-14
lib/gpx_unix/gpx_io.mli
···
···
+3
-163
lib/gpx_unix/gpx_unix.ml
+3
-163
lib/gpx_unix/gpx_unix.ml
···
···
+6
-68
lib/gpx_unix/gpx_unix.mli
+6
-68
lib/gpx_unix/gpx_unix.mli
···-val make_waypoint : lat:float -> lon:float -> ?name:string -> ?desc:string -> unit -> waypoint result
···
+4
-1
mlgpx.opam
+4
-1
mlgpx.opam
···"mlgpx is a streaming GPX (GPS Exchange Format) library for OCaml. It provides a portable core library using the xmlm streaming XML parser, with a separate Unix layer for file I/O operations. The library supports the complete GPX 1.1 specification including waypoints, routes, tracks, and metadata with strong type safety and validation."···
···"mlgpx is a streaming GPX (GPS Exchange Format) library for OCaml. It provides a portable core library using the xmlm streaming XML parser, with a separate Unix layer for file I/O operations. The library supports the complete GPX 1.1 specification including waypoints, routes, tracks, and metadata with strong type safety and validation."···
+1
mlgpx.opam.template
+1
mlgpx.opam.template
···
···
+5
-3
test/dune
+5
-3
test/dune
···
···
+88
-70
test/test_corpus.ml
+88
-70
test/test_corpus.ml
······························
······························
+17
-35
test/test_corpus_unix_eio.ml
+17
-35
test/test_corpus_unix_eio.ml
···············
···············
+27
-33
test/test_gpx.ml
+27
-33
test/test_gpx.ml
·········
·········