pub struct Point {
pub srid: i32,
pub x: f64,
pub y: f64,
pub z: Option<f64>,
}Expand description
A Cypher spatial point. Stored as raw coordinates plus an EPSG
SRID tag — the SRID determines the coordinate reference system
(CRS) and whether z is present:
| SRID | CRS name | Dims | Axes |
|---|---|---|---|
| 7203 | cartesian | 2 | x, y |
| 9157 | cartesian-3d | 3 | x, y, z |
| 4326 | wgs-84 | 2 | longitude (x), latitude (y) |
| 4979 | wgs-84-3d | 3 | longitude, latitude, height |
The 2D/3D distinction is carried by z.is_some() — the SRID is
required to agree with that (a 2D SRID with Some(z), or a 3D
SRID with None, is an invariant violation caller-side).
Matches the Bolt 4.4 Point2D (tag 0x58) / Point3D (tag 0x59)
struct shape so the wire conversion is a straight field copy.
Fields§
§srid: i32§x: f64§y: f64§z: Option<f64>Implementations§
Source§impl Point
impl Point
Sourcepub fn crs_name(&self) -> &'static str
pub fn crs_name(&self) -> &'static str
The CRS name for this point’s SRID, matching Neo4j’s output of
point.crs — e.g. "cartesian", "wgs-84-3d". Returns
"unknown" for any SRID outside the four recognised values.
Sourcepub fn is_geographic(&self) -> bool
pub fn is_geographic(&self) -> bool
True when the SRID is a WGS-84 (geographic) CRS.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Point
impl<'de> Deserialize<'de> for Point
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 Point
impl StructuralPartialEq for Point
Auto Trait Implementations§
impl Freeze for Point
impl RefUnwindSafe for Point
impl Send for Point
impl Sync for Point
impl Unpin for Point
impl UnsafeUnpin for Point
impl UnwindSafe for Point
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