pub trait Densify<F: CoordFloat> {
    type Output;

    // Required method
    fn densify(&self, max_distance: F) -> Self::Output;
}
Expand description

Return a new linear geometry containing both existing and new interpolated coordinates with a maximum distance of max_distance between them.

Note: max_distance must be greater than 0.

Examples

use geo::{coord, Line, LineString};
use geo::Densify;

let line: Line<f64> = Line::new(coord! {x: 0.0, y: 6.0}, coord! {x: 1.0, y: 8.0});
let correct: LineString<f64> = vec![[0.0, 6.0], [0.5, 7.0], [1.0, 8.0]].into();
let max_dist = 2.0;
let densified = line.densify(max_dist);
assert_eq!(densified, correct);

Required Associated Types§

Required Methods§

source

fn densify(&self, max_distance: F) -> Self::Output

Implementors§