pub struct Location(_, _);
Expand description
Location defines a point using it’s latitude and longitude.
Implementations§
source§impl Location
impl Location
sourcepub fn new<T: Into<f64>>(lat: T, lon: T) -> Self
pub fn new<T: Into<f64>>(lat: T, lon: T) -> Self
Create a new Location with it’s degree values of latitude and longitude.
sourcepub fn distance_to(&self, to: &Location) -> Result<f64, String>
pub fn distance_to(&self, to: &Location) -> Result<f64, String>
Find the distance from itself to another point. Internally uses Vincenty’s inverse formula. For better performance and lesser accuracy, consider haversine_distance_to.
sourcepub fn haversine_distance_to(&self, to: &Location) -> f64
pub fn haversine_distance_to(&self, to: &Location) -> f64
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.