Struct geoutils::Location [−][src]
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]
&self,
center: &Location,
radius: Distance
) -> Result<bool, String>
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
impl RefUnwindSafe for Location
impl Send for Location
impl Sync for Location
impl Unpin for Location
impl UnwindSafe for Location
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,