Skip to main content

WaypointPath

Struct WaypointPath 

Source
pub struct WaypointPath { /* private fields */ }
Expand description

A connected sequence of waypoints for distance, speed, and elevation analysis.

Implementations§

Source§

impl WaypointPath

Source

pub fn new(points: Vec<Waypoint>) -> Self

Creates a path from an owned list of waypoints.

Source

pub fn from_slice(points: &[Waypoint]) -> Self

Creates a path from a slice of waypoints.

Source

pub fn with_options(self, options: AnalysisOptions) -> Self

Returns a copy of this path with custom analysis thresholds.

Source

pub fn from_track(track: &Track) -> Vec<WaypointPath>

One WaypointPath per track segment, preserving GPX gap semantics.

Source

pub fn points(&self) -> &[Waypoint]

Ordered waypoints in this path.

Source

pub fn len(&self) -> usize

Number of waypoints in this path.

Source

pub fn is_empty(&self) -> bool

Whether this path contains no waypoints.

Source

pub fn total_distance(&self) -> f64

Total horizontal distance along the path, in meters.

Source

pub fn duration(&self) -> Option<Duration>

Elapsed time from the first to the last timestamped point.

Source

pub fn moving_duration(&self) -> Option<Duration>

Time spent moving (legs at or above the moving-speed threshold).

Source

pub fn average_speed(&self) -> Option<f64>

Average speed over the full duration, in m/s.

Source

pub fn average_moving_speed(&self) -> Option<f64>

Average speed over moving time only, in m/s.

Source

pub fn speeds(&self) -> Vec<Option<f64>>

Instantaneous speed for each leg (length = points - 1), in m/s.

Source

pub fn max_speed(&self) -> Option<f64>

Maximum leg speed, in m/s.

Source

pub fn min_speed(&self) -> Option<f64>

Minimum leg speed, in m/s.

Source

pub fn speed_profile(&self) -> Vec<SpeedProfilePoint>

Timestamp versus speed at the start of each timed leg.

Source

pub fn elevations(&self) -> Vec<Option<f64>>

Per-point elevation values, when present.

Source

pub fn average_elevation(&self) -> Option<f64>

Mean elevation over points that have elevation data.

Source

pub fn max_elevation(&self) -> Option<f64>

Highest elevation among points with elevation data.

Source

pub fn min_elevation(&self) -> Option<f64>

Lowest elevation among points with elevation data.

Source

pub fn elevation_difference(&self) -> Option<f64>

Elevation range from lowest to highest point with elevation data.

Source

pub fn diff_elevation(&self) -> Option<f64>

Source

pub fn total_ascent(&self) -> Option<f64>

Total uphill elevation gain between consecutive points with elevation data.

Source

pub fn total_descent(&self) -> Option<f64>

Total downhill elevation loss between consecutive points with elevation data.

Source

pub fn elevation_profile(&self) -> Vec<ProfilePoint>

Distance versus elevation for points with elevation data.

Distance is accumulated only between consecutive elevation-known points.

Trait Implementations§

Source§

impl Clone for WaypointPath

Source§

fn clone(&self) -> WaypointPath

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WaypointPath

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&Route> for WaypointPath

Source§

fn from(route: &Route) -> Self

Converts to this type from the input type.
Source§

impl From<&TrackSegment> for WaypointPath

Source§

fn from(segment: &TrackSegment) -> Self

Converts to this type from the input type.
Source§

impl<'a> IntoIterator for &'a WaypointPath

Source§

type Item = &'a Waypoint

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, Waypoint>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl PartialEq for WaypointPath

Source§

fn eq(&self, other: &WaypointPath) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for WaypointPath

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.