[−][src]Trait geo::algorithm::simplifyvw::SimplifyVwIdx
Simplifies a geometry, returning the retained indices of the output
This operation uses the Visvalingam-Whyatt algorithm, and does not guarantee that the returned geometry is valid.
Required methods
fn simplifyvw_idx(&self, epsilon: &T) -> Vec<usize> where
T: Float,
T: Float,
Returns the simplified representation of a geometry, using the Visvalingam-Whyatt algorithm
See here for a graphical explanation
Examples
use geo::algorithm::simplifyvw::SimplifyVwIdx; use geo::line_string; let line_string = line_string![ (x: 5.0, y: 2.0), (x: 3.0, y: 8.0), (x: 6.0, y: 20.0), (x: 7.0, y: 25.0), (x: 10.0, y: 10.0), ]; let simplified = line_string.simplifyvw_idx(&30.0); let expected = vec![ 0_usize, 3_usize, 4_usize, ]; assert_eq!(expected, simplified);
Implementors
impl<T> SimplifyVwIdx<T, T> for LineString<T> where
T: Float,
[src]
T: Float,