Struct geoutils::Location[][src]

pub struct Location(_, _);

Location defines a point using it’s latitude and longitude.

Implementations

impl Location[src]

pub fn new<T: Into<f64>>(lat: T, lon: T) -> Self[src]

Create a new Location with it’s degree values of latitude and longitude.

pub fn latitude(&self) -> f64[src]

Get the latitude.

pub fn longitude(&self) -> f64[src]

Get the longitude.

pub fn distance_to(&self, to: &Location) -> Result<Distance, String>[src]

Find the distance from itself to another point. Internally uses Vincenty’s inverse formula. For better performance and lesser accuracy, consider haversine_distance_to. This method returns Err if the formula fails to converge within 100 iterations.

pub fn haversine_distance_to(&self, to: &Location) -> Distance[src]

Find the distance from itself to another point using Haversine formula. This is usually computationally less intensive than distance_to but is generally not as accurate.

pub fn is_in_circle(
    &self,
    center: &Location,
    radius: Distance
) -> Result<bool, String>
[src]

Check if the point is within a fixed radius of another point.

pub fn center(coords: &[&Location]) -> Location[src]

Find the center of given locations.

Trait Implementations

impl Clone for Location[src]

impl Copy for Location[src]

impl Debug for Location[src]

impl PartialEq<Location> for Location[src]

impl StructuralPartialEq for Location[src]

Auto Trait Implementations

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> From<T> for T[src]

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

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.