pub struct SpatialCoordinate {
pub x: f64,
pub y: f64,
pub z: Option<f64>,
}Expand description
Spatial coordinates for geographic data
Fields§
§x: f64§y: f64§z: Option<f64>Implementations§
Source§impl SpatialCoordinate
impl SpatialCoordinate
pub fn new(x: f64, y: f64) -> Self
pub fn new_3d(x: f64, y: f64, z: f64) -> Self
Sourcepub fn distance(&self, other: &SpatialCoordinate) -> f64
pub fn distance(&self, other: &SpatialCoordinate) -> f64
Calculate Euclidean distance between two coordinates
Sourcepub fn haversine_distance(&self, other: &SpatialCoordinate) -> f64
pub fn haversine_distance(&self, other: &SpatialCoordinate) -> f64
Calculate Haversine distance for lat/lon coordinates (in kilometers)
Trait Implementations§
Source§impl Clone for SpatialCoordinate
impl Clone for SpatialCoordinate
Source§fn clone(&self) -> SpatialCoordinate
fn clone(&self) -> SpatialCoordinate
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SpatialCoordinate
impl Debug for SpatialCoordinate
impl Copy for SpatialCoordinate
Auto Trait Implementations§
impl Freeze for SpatialCoordinate
impl RefUnwindSafe for SpatialCoordinate
impl Send for SpatialCoordinate
impl Sync for SpatialCoordinate
impl Unpin for SpatialCoordinate
impl UnwindSafe for SpatialCoordinate
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more