+32
-11
.tangled/workflows/build.yml
+32
-11
.tangled/workflows/build.yml
···
+2
-4
README.md
+2
-4
README.md
·········
+1
-1
bin/dune
+1
-1
bin/dune
+450
-1
bin/mlgpx_cli.ml
+450
-1
bin/mlgpx_cli.ml
···+Format.kfprintf (fun fmt -> Format.pp_print_newline fmt (); Format.pp_print_flush fmt ()) Format.err_formatter fmt+Format.kfprintf (fun fmt -> Format.pp_print_newline fmt (); Format.pp_print_flush fmt ()) Format.err_formatter fmt+Format.kfprintf (fun fmt -> Format.pp_print_newline fmt (); Format.pp_print_flush fmt ()) Format.std_formatter fmt+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>");+Fmt.pf Format.std_formatter " Start: %a\n" (info_style Fmt.string) (Ptime.to_rfc3339 start_time);+Fmt.pf Format.std_formatter " Stop: %a\n" (info_style Fmt.string) (Ptime.to_rfc3339 stop_time);+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.")
example_output.gpx
example_output.gpx
This is a binary file and will not be displayed.
-5
examples/dune
-5
examples/dune
-117
examples/effects_example.ml
-117
examples/effects_example.ml
···
+9
-12
examples/simple_gpx.ml
+9
-12
examples/simple_gpx.ml
···-Printf.printf "โ Created waypoint: %s\n" (Option.value (Waypoint.get_name wpt) ~default:"<unnamed>");+Printf.printf "โ Created waypoint: %s\n" (Option.value (Waypoint.name wpt) ~default:"<unnamed>");-let metadata = Metadata.with_description metadata "Demonstration of mlgpx library capabilities" in+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······
+2
-2
lib/gpx/coordinate.ml
+2
-2
lib/gpx/coordinate.ml
+8
-8
lib/gpx/coordinate.mli
+8
-8
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
···-(modules gpx parser writer validate coordinate link extension waypoint metadata route track error gpx_doc))
+8
-8
lib/gpx/extension.ml
+8
-8
lib/gpx/extension.ml
·········
+8
-8
lib/gpx/extension.mli
+8
-8
lib/gpx/extension.mli
···-val make : namespace:string option -> name:string -> attributes:(string * string) list -> content:content -> unit -> t+val make : ?namespace:string -> name:string -> attributes:(string * string) list -> content:content -> unit -> tval make_text : name:string -> ?namespace:string -> ?attributes:(string * string) list -> string -> t······
+6
-6
lib/gpx/gpx.ml
+6
-6
lib/gpx/gpx.ml
·········
+443
-54
lib/gpx/gpx.mli
+443
-54
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") *)
-196
lib/gpx/gpx_doc.ml
-196
lib/gpx/gpx_doc.ml
···
-134
lib/gpx/gpx_doc.mli
-134
lib/gpx/gpx_doc.mli
···
+11
-11
lib/gpx/link.ml
+11
-11
lib/gpx/link.ml
·········
+12
-11
lib/gpx/link.mli
+12
-11
lib/gpx/link.mli
·········
+31
-30
lib/gpx/metadata.ml
+31
-30
lib/gpx/metadata.ml
······
+27
-24
lib/gpx/metadata.mli
+27
-24
lib/gpx/metadata.mli
···val make_from_floats : minlat:float -> minlon:float -> maxlat:float -> maxlon:float -> (t, string) result-val get_bounds : t -> (Coordinate.latitude * Coordinate.longitude * Coordinate.latitude * Coordinate.longitude)+val bounds : t -> (Coordinate.latitude * Coordinate.longitude * Coordinate.latitude * Coordinate.longitude)···
+127
-9
lib/gpx/parser.ml
+127
-9
lib/gpx/parser.ml
············+(match Metadata.Bounds.make_from_floats ~minlat:minlat_f ~minlon:minlon_f ~maxlat:maxlat_f ~maxlon:maxlon_f with······
+2
-2
lib/gpx/parser.mli
+2
-2
lib/gpx/parser.mli
···
+30
-17
lib/gpx/route.ml
+30
-17
lib/gpx/route.ml
·········
+31
-19
lib/gpx/route.mli
+31
-19
lib/gpx/route.mli
············
+34
-18
lib/gpx/track.ml
+34
-18
lib/gpx/track.ml
···············
+34
-19
lib/gpx/track.mli
+34
-19
lib/gpx/track.mli
···············
+23
-23
lib/gpx/validate.ml
+23
-23
lib/gpx/validate.ml
···issues := make_warning ~location ("Negative satellite count: " ^ string_of_int sat) :: !issues·································
+4
-4
lib/gpx/validate.mli
+4
-4
lib/gpx/validate.mli
···
+39
-53
lib/gpx/waypoint.ml
+39
-53
lib/gpx/waypoint.ml
···
+40
-52
lib/gpx/waypoint.mli
+40
-52
lib/gpx/waypoint.mli
···val make_from_floats : lat:float -> lon:float -> ?name:string -> ?desc:string -> unit -> (t, string) result
+242
-29
lib/gpx/writer.ml
+242
-29
lib/gpx/writer.ml
······+| 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······
+2
-2
lib/gpx/writer.mli
+2
-2
lib/gpx/writer.mli
···
+1
-1
lib/gpx_eio/dune
+1
-1
lib/gpx_eio/dune
+6
-71
lib/gpx_eio/gpx_eio.ml
+6
-71
lib/gpx_eio/gpx_eio.ml
······
+11
-74
lib/gpx_eio/gpx_eio.mli
+11
-74
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.t-val make_track_from_coords : fs:[> Eio.Fs.dir_ty ] Eio.Path.t -> name:string -> (float * float) list -> Gpx.Track.t-val make_route_from_coords : fs:[> Eio.Fs.dir_ty ] Eio.Path.t -> name:string -> (float * float) list -> Gpx.Route.t
+1
-3
lib/gpx_eio/gpx_io.ml
+1
-3
lib/gpx_eio/gpx_io.ml
······
+1
-1
lib/gpx_unix/dune
+1
-1
lib/gpx_unix/dune
+2
-112
lib/gpx_unix/gpx_unix.ml
+2
-112
lib/gpx_unix/gpx_unix.ml
······
+2
-54
lib/gpx_unix/gpx_unix.mli
+2
-54
lib/gpx_unix/gpx_unix.mli
······-val make_waypoint : lat:float -> lon:float -> ?name:string -> ?desc:string -> unit -> (Waypoint.t, error) 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."···
+1
mlgpx.opam.template
+1
mlgpx.opam.template
···
+5
-2
test/dune
+5
-2
test/dune
···
+53
-50
test/test_corpus.ml
+53
-50
test/test_corpus.ml
·································
+15
-15
test/test_corpus_unix_eio.ml
+15
-15
test/test_corpus_unix_eio.ml
············-check string "Creators match" (Gpx.Gpx_doc.get_creator gpx_unix) (Gpx.Gpx_doc.get_creator gpx_eio);-(List.length (Gpx.Gpx_doc.get_waypoints gpx_unix)) (List.length (Gpx.Gpx_doc.get_waypoints gpx_eio));-(List.length (Gpx.Gpx_doc.get_routes gpx_unix)) (List.length (Gpx.Gpx_doc.get_routes gpx_eio));···
+11
-12
test/test_gpx.ml
+11
-12
test/test_gpx.ml
············