pub struct GPXReader {
pub gpx: GPX,
}Expand description
§GPX Reader
§Description
The GPX Reader is an XML-based GPS Exchange Format (GPX) reader.
GPX (the GPS Exchange Format) is a light-weight XML data format for the interchange of GPS data (waypoints, routes, and tracks) between applications and Web services on the Internet.
Implements the FeatureReader trait
§Usage
The methods you have access to:
GPXReader::new: Create a new GPXReaderGPXReader::metadata: Get the metadataGPXReader::iter: Iterate over the featuresGPXReader::par_iter: Iterate over the features in parallel
use gistools::{
parsers::{FeatureReader, FileReader},
readers::{GPXReader},
};
use std::path::PathBuf;
let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
path.push("tests/readers/gpx/fixtures/gpx-test-short.gpx");
let gpx_string = std::fs::read_to_string(path).unwrap();
let gpx_data = GPXReader::new(&gpx_string);
let features: Vec<_> = gpx_data.iter().collect();
assert_eq!(features.len(), 4);§Links
Fields§
§gpx: GPXGPX object
Implementations§
Trait Implementations§
Source§impl FeatureReader<(), GPXProperties, GPXWaypoint> for GPXReader
A feature reader trait with a callback-based approach
impl FeatureReader<(), GPXProperties, GPXWaypoint> for GPXReader
A feature reader trait with a callback-based approach
Source§type FeatureIterator<'a> = GPXIterator<'a>
type FeatureIterator<'a> = GPXIterator<'a>
The Feature Reader should implement an iterator of some kind
Source§fn iter(&self) -> Self::FeatureIterator<'_>
fn iter(&self) -> Self::FeatureIterator<'_>
All readers have an iter function that returns a Iterator struct
Auto Trait Implementations§
impl Freeze for GPXReader
impl RefUnwindSafe for GPXReader
impl Send for GPXReader
impl Sync for GPXReader
impl Unpin for GPXReader
impl UnwindSafe for GPXReader
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more