geo::algorithm::line_measures

Trait InterpolatePoint

Source
pub trait InterpolatePoint<F: CoordFloat> {
    // Required methods
    fn point_at_distance_between(
        start: Point<F>,
        end: Point<F>,
        distance_from_start: F,
    ) -> Point<F>;
    fn point_at_ratio_between(
        start: Point<F>,
        end: Point<F>,
        ratio_from_start: F,
    ) -> Point<F>;
    fn points_along_line(
        start: Point<F>,
        end: Point<F>,
        max_distance: F,
        include_ends: bool,
    ) -> impl Iterator<Item = Point<F>>;
}
Expand description

Interpolate a Point along a line between two existing points

Required Methods§

Source

fn point_at_distance_between( start: Point<F>, end: Point<F>, distance_from_start: F, ) -> Point<F>

Returns a new Point along a line between two existing points.

See specific implementations for details.

Source

fn point_at_ratio_between( start: Point<F>, end: Point<F>, ratio_from_start: F, ) -> Point<F>

Returns a new Point along a line between two existing points.

See specific implementations for details.

Source

fn points_along_line( start: Point<F>, end: Point<F>, max_distance: F, include_ends: bool, ) -> impl Iterator<Item = Point<F>>

Interpolates Points along a line between start and end.

See specific implementations for details.

As many points as necessary will be added such that the distance between points never exceeds max_distance. If the distance between start and end is less than max_distance, no additional points will be included in the output.

include_ends: Should the start and end points be included in the output?

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl InterpolatePoint<f64> for Geodesic

Interpolate Point(s) along a geodesic line.

Source§

impl<F: CoordFloat + FromPrimitive> InterpolatePoint<F> for Euclidean

Interpolate Point(s) along a line on the Euclidean plane.

Source§

impl<F: CoordFloat + FromPrimitive> InterpolatePoint<F> for Haversine

Interpolate Point(s) along a great circle.

Source§

impl<F: CoordFloat + FromPrimitive> InterpolatePoint<F> for Rhumb

Interpolate Point(s) along a rhumb line.