[][src]Struct transit_model::objects::Coord

pub struct Coord {
    pub lon: f64,
    pub lat: f64,
}

Fields

lon: f64lat: f64

Implementations

impl Coord[src]

pub fn distance_to(&self, other: &Self) -> f64[src]

Calculate the orthodromic distance in meters between 2 geographic coordinates

pub fn approx(&self) -> Approx[src]

Returns a proxy object allowing to compute approximate distances for cheap computation.

Example

let v: Vec<Coord> = get_coords();
let from = Coord { lon: 2.37715, lat: 48.846_781 };
let approx = from.approx();
for coord in &v {
    println!("distance({:?}, {:?}) = {}", from, coord, approx.sq_distance_to(coord).sqrt());
}

Trait Implementations

impl Clone for Coord[src]

impl Copy for Coord[src]

impl Debug for Coord[src]

impl Default for Coord[src]

impl<'de> Deserialize<'de> for Coord[src]

impl From<(String, String)> for Coord[src]

impl From<Coord> for (String, String)[src]

impl From<Point<f64>> for Coord[src]

impl Into<Point<f64>> for Coord[src]

impl PartialEq<Coord> for Coord[src]

impl Serialize for Coord[src]

impl StructuralPartialEq for Coord[src]

Auto Trait Implementations

impl RefUnwindSafe for Coord

impl Send for Coord

impl Sync for Coord

impl Unpin for Coord

impl UnwindSafe for Coord

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,