Expand description
§RapidGeo Similarity
Fast trajectory similarity measures for geographic polylines.
This crate provides efficient implementations of curve similarity algorithms specifically designed for geographic data. It includes:
- Fréchet distance - Measures similarity while considering point order
- Hausdorff distance - Measures maximum deviation between curves
- Batch processing - Parallel computation for multiple comparisons
All algorithms use great-circle distance (haversine) for geographic accuracy.
§Quick Start
use rapidgeo_similarity::{discrete_frechet_distance, LngLat};
let route1 = vec![
LngLat::new_deg(-122.0, 37.0),
LngLat::new_deg(-122.1, 37.1),
];
let route2 = vec![
LngLat::new_deg(-122.0, 37.0),
LngLat::new_deg(-122.2, 37.2),
];
let distance = discrete_frechet_distance(&route1, &route2).unwrap();
println!("Fréchet distance: {} meters", distance);§Choosing an Algorithm
- Fréchet distance: Use when point order matters (e.g., comparing GPS tracks)
- Hausdorff distance: Use when only shape matters (e.g., comparing building outlines)
§Features
batch- Enables parallel batch processing functions (requires rayon)
Re-exports§
pub use frechet::discrete_frechet_distance;pub use frechet::discrete_frechet_distance_with_threshold;pub use frechet::DiscreteFrechet;pub use hausdorff::hausdorff_distance;pub use hausdorff::hausdorff_distance_with_threshold;pub use hausdorff::Hausdorff;pub use batch::batch_frechet_distance;pub use batch::batch_frechet_distance_threshold;pub use batch::pairwise_frechet_matrix;
Modules§
Structs§
- LngLat
- A geographic coordinate in decimal degrees.
Enums§
- Similarity
Error - Errors that can occur when computing similarity measures.
Traits§
- Similarity
Measure - A trait for measuring similarity between two polylines.