Struct gpx::Waypoint

source ·
pub struct Waypoint {
Show 19 fields pub elevation: Option<f64>, pub speed: Option<f64>, pub time: Option<Time>, pub name: Option<String>, pub comment: Option<String>, pub description: Option<String>, pub source: Option<String>, pub links: Vec<Link>, pub symbol: Option<String>, pub type_: Option<String>, pub geoidheight: Option<f64>, pub fix: Option<Fix>, pub sat: Option<u64>, pub hdop: Option<f64>, pub vdop: Option<f64>, pub pdop: Option<f64>, pub age: Option<f64>, pub dgps_age: Option<f64>, pub dgpsid: Option<u16>, /* private fields */
}
Expand description

Waypoint represents a waypoint, point of interest, or named feature on a map.

Fields§

§elevation: Option<f64>

Elevation (in meters) of the point.

§speed: Option<f64>

Speed (in meters per second) (only in GPX 1.0)

§time: Option<Time>

Creation/modification timestamp for element. Date and time in are in Univeral Coordinated Time (UTC), not local time! Conforms to ISO 8601 specification for date/time representation. Fractional seconds are allowed for millisecond timing in tracklogs.

§name: Option<String>

The GPS name of the waypoint. This field will be transferred to and from the GPS. GPX does not place restrictions on the length of this field or the characters contained in it. It is up to the receiving application to validate the field before sending it to the GPS.

§comment: Option<String>

GPS waypoint comment. Sent to GPS as comment.

§description: Option<String>

A text description of the element. Holds additional information about the element intended for the user, not the GPS.

§source: Option<String>

Source of data. Included to give user some idea of reliability and accuracy of data. “Garmin eTrex”, “USGS quad Boston North”, e.g.

§links: Vec<Link>

Links to additional information about the waypoint.

§symbol: Option<String>

Text of GPS symbol name. For interchange with other programs, use the exact spelling of the symbol as displayed on the GPS. If the GPS abbreviates words, spell them out.

§type_: Option<String>

Type (classification) of the waypoint.

§geoidheight: Option<f64>

Height of geoid in meters above WGS 84. This correspond to the sea level.

§fix: Option<Fix>

Type of GPS fix. none means GPS had no fix. To signify “the fix info is unknown”, leave out fix entirely. Value comes from the list {'none'|'2d'|'3d'|'dgps'|'pps'}, where pps means that the military signal was used.

§sat: Option<u64>

Number of satellites used to calculate the GPX fix.

§hdop: Option<f64>

Horizontal dilution of precision.

§vdop: Option<f64>

Vertical dilution of precision.

§pdop: Option<f64>

Positional dilution of precision.

§age: Option<f64>
👎Deprecated: Prior to gpx 0.9.0 version crate used incorrect field to parse and emit DGPS age. Use dgps_age instead. See https://github.com/georust/gpx/issues/21
§dgps_age: Option<f64>

Number of seconds since last DGPS update, from the element.

§dgpsid: Option<u16>

ID of DGPS station used in differential correction, in the range [0, 1023].

Implementations§

source§

impl Waypoint

source

pub fn point(&self) -> Point<f64>

Gives the geographical point of the waypoint.

extern crate geo_types;
extern crate gpx;

use gpx::Waypoint;
use geo_types::Point;

fn main() {
    // Kind of useless, but it shows the point.
    let wpt = Waypoint::new(Point::new(-121.97, 37.24));
    let point = wpt.point();

    println!("waypoint latitude: {}, longitude: {}", point.x(), point.y());
}
source

pub fn new(point: Point<f64>) -> Waypoint

Creates a new Waypoint from a given geographical point.

extern crate geo_types;
extern crate gpx;

use gpx::Waypoint;
use geo_types::Point;

fn main() {
    let point = Point::new(-121.97, 37.24);

    let mut wpt = Waypoint::new(point);
    wpt.elevation = Some(553.21);
}

Trait Implementations§

source§

impl Clone for Waypoint

source§

fn clone(&self) -> Waypoint

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Waypoint

source§

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

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

impl Default for Waypoint

source§

fn default() -> Waypoint

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Waypoint

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<Waypoint> for Geometry<f64>

source§

fn from(waypoint: Waypoint) -> Geometry<f64>

Converts to this type from the input type.
source§

impl PartialEq for Waypoint

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Waypoint

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for Waypoint

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> 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,

§

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>,

§

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>,

§

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.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,