pub struct GeoSpace { /* private fields */ }Expand description
A non-Euclidean spatial context based on geodetic coordinates (WGS84).
GeoSpace represents a geographic location on Earth using the WGS84 standard.
It stores latitude, longitude, and altitude, and is commonly used in systems that need to model real-world positions,
such as navigation, mapping, remote sensing, and sensor fusion applications.
Unlike Euclidean coordinates, geodetic coordinates model the Earth’s surface as a curved ellipsoid rather than a flat plane.
This makes GeoSpace a simple yet powerful non-Euclidean spatial representation that integrates naturally with GPS and global datasets.
§Fields
id: A unique numeric identifier for the location (e.g., sensor ID, region ID)lat: Latitude in degrees (positive north, negative south)lon: Longitude in degrees (positive east, negative west)alt: Altitude in meters above the WGS84 ellipsoid (not above sea level)
§Trait Implementations
This type implements:
IdentifiableCoordinate<f64>Metricusing the Haversine approximationSpatial<f64>Displayfor human-readable output
§Common Use Cases
- Geographic sensor modeling (e.g., magnetometers on aircraft, buoys, satellites)
- Location-aware causal contexts (e.g., MagNav, remote sensing calibration)
- Contextualizing non-Euclidean geospatial data in DeepCausality graphs
§Example
use deep_causality::*;
let g1 = GeoSpace::new(1, 52.520008, 13.404954, 34.0); // Berlin, Germany
let g2 = GeoSpace::new(2, 48.856613, 2.352222, 35.0); // Paris, France
println!("{}", g1);
let distance = g1.distance(&g2);
println!("Distance (approx): {:.2} km", distance / 1000.0);§Output
GeoSpace(id="1", lat=52.520008, lon=13.404954, alt=34m)
Distance (approx): 878.84 kmImplementations§
Trait Implementations§
Source§impl Adjustable<f64> for GeoSpace
impl Adjustable<f64> for GeoSpace
Source§fn update<const W: usize, const H: usize, const D: usize, const C: usize>(
&mut self,
array_grid: &ArrayGrid<f64, W, H, D, C>,
) -> Result<(), UpdateError>
fn update<const W: usize, const H: usize, const D: usize, const C: usize>( &mut self, array_grid: &ArrayGrid<f64, W, H, D, C>, ) -> Result<(), UpdateError>
The default implementation does nothing to keep update optional.
Override this method to implement a node update when needed.
For a sample implementation, see src/types/context_types/node_types_adjustable
Source§fn adjust<const W: usize, const H: usize, const D: usize, const C: usize>(
&mut self,
array_grid: &ArrayGrid<f64, W, H, D, C>,
) -> Result<(), AdjustmentError>
fn adjust<const W: usize, const H: usize, const D: usize, const C: usize>( &mut self, array_grid: &ArrayGrid<f64, W, H, D, C>, ) -> Result<(), AdjustmentError>
The default implementation does nothing to keep adjustment optional.
Override this method to implement a node adjustment when needed.
Depending on the type of node adjustment, select a 1, 2,3, or 4 dimensional array grid
that contains the transformation data to apply to the node.
For a sample implementation, see src/types/context_types/node_types_adjustable
Source§impl Coordinate<f64> for GeoSpace
impl Coordinate<f64> for GeoSpace
Source§impl Display for GeoSpace
Implements human-readable formatting for a geographic spatial context.
impl Display for GeoSpace
Implements human-readable formatting for a geographic spatial context.
Format:
GeoSpace(id="S1", lat=52.52, lon=13.405, alt=34.0)impl Spatial<f64> for GeoSpace
impl StructuralPartialEq for GeoSpace
Auto Trait Implementations§
impl Freeze for GeoSpace
impl RefUnwindSafe for GeoSpace
impl Send for GeoSpace
impl Sync for GeoSpace
impl Unpin for GeoSpace
impl UnwindSafe for GeoSpace
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