pub fn simplify_batch(
polylines: &[Vec<LngLat>],
tolerance_m: f64,
method: SimplifyMethod,
) -> Vec<Vec<LngLat>>Expand description
Simplify multiple polylines sequentially.
Processes polylines one at a time in a single thread. Use this when:
- Processing few polylines
- Polylines are small
- Memory usage is more important than speed
- The
batchfeature is not enabled
ยงExamples
use rapidgeo_distance::LngLat;
use rapidgeo_simplify::{batch::simplify_batch, SimplifyMethod};
let polylines = vec![
vec![
LngLat::new_deg(-122.0, 37.0),
LngLat::new_deg(-121.5, 37.5),
LngLat::new_deg(-121.0, 37.0),
],
];
let simplified = simplify_batch(
&polylines,
1000.0,
SimplifyMethod::GreatCircleMeters,
);
assert_eq!(simplified.len(), 1);
assert!(simplified[0].len() >= 2); // Endpoints preserved