pub struct GeoPoint {
pub lat: f64,
pub lon: f64,
}Expand description
Geographic point for spatial queries (Issue #356)
Represents a WGS84 coordinate for spatial filtering.
Fields§
§lat: f64Latitude in degrees (-90 to 90)
lon: f64Longitude in degrees (-180 to 180)
Implementations§
Source§impl GeoPoint
impl GeoPoint
Sourcepub fn distance_to(&self, other: &GeoPoint) -> f64
pub fn distance_to(&self, other: &GeoPoint) -> f64
Calculate haversine distance to another point in meters
Uses the haversine formula for great-circle distance on a sphere.
Sourcepub fn within_bounds(&self, min: &GeoPoint, max: &GeoPoint) -> bool
pub fn within_bounds(&self, min: &GeoPoint, max: &GeoPoint) -> bool
Check if this point is within a bounding box
Sourcepub fn within_radius(&self, center: &GeoPoint, radius_meters: f64) -> bool
pub fn within_radius(&self, center: &GeoPoint, radius_meters: f64) -> bool
Check if this point is within a radius of another point
Trait Implementations§
Source§impl<'de> Deserialize<'de> for GeoPoint
impl<'de> Deserialize<'de> for GeoPoint
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for GeoPoint
impl StructuralPartialEq for GeoPoint
Auto Trait Implementations§
impl Freeze for GeoPoint
impl RefUnwindSafe for GeoPoint
impl Send for GeoPoint
impl Sync for GeoPoint
impl Unpin for GeoPoint
impl UnsafeUnpin for GeoPoint
impl UnwindSafe for GeoPoint
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