Struct gpx::TrackSegment
source · pub struct TrackSegment {
pub points: Vec<Waypoint>,
}
Expand description
TrackSegment represents a list of track points.
This TrackSegment holds a list of Track Points which are logically connected in order. To represent a single GPS track where GPS reception was lost, or the GPS receiver was turned off, start a new Track Segment for each continuous span of track data.
Fields§
§points: Vec<Waypoint>
Each Waypoint holds the coordinates, elevation, timestamp, and metadata for a single point in a track.
Implementations§
source§impl TrackSegment
impl TrackSegment
sourcepub fn linestring(&self) -> LineString<f64>
pub fn linestring(&self) -> LineString<f64>
Gives the linestring of the segment’s points, the sequence of points that comprises the track segment.
sourcepub fn new() -> TrackSegment
pub fn new() -> TrackSegment
Creates a new TrackSegment with default values.
extern crate gpx;
extern crate geo_types;
use gpx::{TrackSegment, Waypoint};
use geo_types::Point;
fn main() {
let mut trkseg: TrackSegment = TrackSegment::new();
let point = Waypoint::new(Point::new(-121.97, 37.24));
trkseg.points.push(point);
}
Trait Implementations§
source§impl Clone for TrackSegment
impl Clone for TrackSegment
source§fn clone(&self) -> TrackSegment
fn clone(&self) -> TrackSegment
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for TrackSegment
impl Debug for TrackSegment
source§impl Default for TrackSegment
impl Default for TrackSegment
source§fn default() -> TrackSegment
fn default() -> TrackSegment
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for TrackSegment
impl<'de> Deserialize<'de> for TrackSegment
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 PartialEq for TrackSegment
impl PartialEq for TrackSegment
source§fn eq(&self, other: &TrackSegment) -> bool
fn eq(&self, other: &TrackSegment) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for TrackSegment
impl Serialize for TrackSegment
impl StructuralPartialEq for TrackSegment
Auto Trait Implementations§
impl RefUnwindSafe for TrackSegment
impl Send for TrackSegment
impl Sync for TrackSegment
impl Unpin for TrackSegment
impl UnwindSafe for TrackSegment
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more