[][src]Struct geom::LonLat

pub struct LonLat {
    longitude: NotNan<f64>,
    latitude: NotNan<f64>,
}

Represents a (longitude, latitude) point.

Fields

longitude: NotNan<f64>latitude: NotNan<f64>

Implementations

impl LonLat[src]

pub fn new(lon: f64, lat: f64) -> LonLat[src]

Note the order of arguments!

pub fn x(self) -> f64[src]

Returns the longitude of this point.

pub fn y(self) -> f64[src]

Returns the latitude of this point.

pub(crate) fn gps_dist(self, other: LonLat) -> Distance[src]

Returns the Haversine distance to another point.

pub fn fast_dist(self, other: LonLat) -> NotNan<f64>[src]

Pretty meaningless units, for comparing distances very roughly

pub fn read_osmosis_polygon(path: String) -> Result<Vec<LonLat>, Box<dyn Error>>[src]

Parses a file in the https://wiki.openstreetmap.org/wiki/Osmosis/Polygon_Filter_File_Format and returns all points.

Trait Implementations

impl Clone for LonLat[src]

impl Copy for LonLat[src]

impl Debug for LonLat[src]

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

impl Display for LonLat[src]

impl Eq for LonLat[src]

impl Ord for LonLat[src]

impl PartialEq<LonLat> for LonLat[src]

impl PartialOrd<LonLat> for LonLat[src]

impl Serialize for LonLat[src]

impl StructuralEq for LonLat[src]

impl StructuralPartialEq for LonLat[src]

Auto Trait Implementations

impl RefUnwindSafe for LonLat

impl Send for LonLat

impl Sync for LonLat

impl Unpin for LonLat

impl UnwindSafe for LonLat

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> ToString for T where
    T: Display + ?Sized
[src]

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.