Expand description
§tracematch
High-performance GPS route matching library for fitness applications.
This library provides:
- GPS route matching using Average Minimum Distance (AMD)
- Route grouping and clustering algorithms
- Frequent section detection (multi-scale)
- Activity heatmap generation
- Parallel processing for batch operations
§Features
parallel- Enable parallel processing with rayon (default)
§Quick Start
use tracematch::{GpsPoint, RouteSignature, MatchConfig, compare_routes};
// Create route signatures from GPS points
let route1 = vec![
GpsPoint::new(51.5074, -0.1278),
GpsPoint::new(51.5080, -0.1290),
GpsPoint::new(51.5090, -0.1300),
];
let route2 = route1.clone(); // Same route
let sig1 = RouteSignature::from_points("activity-1", &route1, &MatchConfig::default());
let sig2 = RouteSignature::from_points("activity-2", &route2, &MatchConfig::default());
if let (Some(s1), Some(s2)) = (sig1, sig2) {
if let Some(result) = compare_routes(&s1, &s2, &MatchConfig::default()) {
println!("Match: {}% ({})", result.match_percentage, result.direction);
}
}Re-exports§
pub use error::OptionExt;pub use error::Result;pub use error::RouteMatchError;pub use union_find::UnionFind;pub use matching::compare_routes;pub use grouping::group_incremental;pub use grouping::group_signatures_parallel;pub use grouping::group_signatures_parallel_with_matches;pub use grouping::group_signatures;pub use grouping::group_signatures_with_matches;pub use grouping::should_group_routes;pub use sections::DetectionStats;pub use sections::FrequentSection;pub use sections::MultiScaleSectionResult;pub use sections::PotentialSection;pub use sections::ScalePreset;pub use sections::SectionConfig;pub use sections::SectionMatch;pub use sections::SectionPortion;pub use sections::SplitResult;pub use sections::detect_sections_from_tracks;pub use sections::detect_sections_multiscale;pub use sections::find_sections_in_route;pub use sections::recalculate_section_polyline;pub use sections::split_section_at_index;pub use sections::split_section_at_point;pub use heatmap::ActivityHeatmapData;pub use heatmap::CellQueryResult;pub use heatmap::HeatmapBounds;pub use heatmap::HeatmapCell;pub use heatmap::HeatmapConfig;pub use heatmap::HeatmapResult;pub use heatmap::RouteRef;pub use heatmap::generate_heatmap;pub use heatmap::query_heatmap_cell;
Modules§
- algorithms
- Algorithm Toolbox
- error
- Unified error handling for the tracematch library.
- geo_
utils - Geographic Utilities
- grouping
- Route grouping algorithms.
- heatmap
- Heatmap generation with route intelligence.
- matching
- Route matching algorithms using Average Minimum Distance (AMD).
- sections
- Adaptive Consensus Section Detection
- union_
find - Union-Find (Disjoint Set Union) data structure.
Structs§
- Activity
Match Info - Match info for an activity within a route group. Stores how well the activity matches the representative route.
- Activity
Metrics - Activity metadata for performance calculations. Stores the non-GPS data needed for performance comparison.
- Bounds
- Bounding box for a route.
- Custom
Section - A user-created custom section definition.
- Custom
Section Match - A match between a custom section and an activity.
- Custom
Section Match Config - Configuration for custom section matching.
- GpsPoint
- A GPS coordinate with latitude and longitude.
- Grouping
Result - Result from grouping signatures, including per-activity match info.
- Match
Config - Configuration for route matching algorithms.
- Match
Result - Result of comparing two routes.
- Route
Bounds - Bounding box for a route (used for spatial indexing).
- Route
Group - A group of similar routes.
- Route
Performance - A single performance point for route comparison.
- Route
Performance Result - Complete route performance result.
- Route
Signature - A simplified route signature for efficient matching.
- Section
Lap - A single lap of a section.
- Section
Performance Record - Section performance record for an activity.
- Section
Performance Result - Complete section performance result.
Functions§
- elapsed_
ms - Helper to calculate elapsed milliseconds from an Instant