Skip to main content

gpx_rs/
lib.rs

1//! GPX manipulation library.
2
3pub mod gpx;
4
5pub use gpx::{
6    convert_file, crop, detect_format, filter_points, gather, merge, merge_with_creator,
7    print_human, read_geojson, read_gpx, read_kml, reduce_precision, reverse, shift_time,
8    simplify, smooth, smooth_with_options, split, strip_extensions, strip_metadata, to_string,
9    trim, validate_file, validate_str, write_file, write_geojson, write_kml, AnalysisOptions,
10    Bounds, BoundsInfo, ConvertError, Copyright, ElevationInfo, Email, Extensions, Fix, Gpx,
11    GpxInfo, GPXTPTX_NS_V1, GPXTPTX_NS_V2, GPXX_NS_V3, GPPXPX_NS_V1, InvalidGpxError, Link,
12    Metadata, OperationError, ParseError, Person, Point, PointSegment, PowerExtension,
13    ProfilePoint, Route, RouteInfo, Severity, SmoothOptions, SpeedProfilePoint,
14    StripMetadataFields, Track, TrackExtension, TrackInfo, TrackPointExtension, TrackSegment, ValidationIssue, ValidationResult,
15    Waypoint, WaypointPath,
16};
17
18/// Parse a GPX document from XML text.
19pub fn parse(data: &str) -> Result<Gpx, ParseError> {
20    gpx::parse(data)
21}
22
23/// Parse a GPX document from a file path.
24pub fn parse_file(path: impl AsRef<std::path::Path>) -> Result<Gpx, ParseError> {
25    Gpx::parse_file(path)
26}