pub struct Coordinate {
pub x: f64,
pub y: f64,
pub z: Option<f64>,
pub m: Option<f64>,
}Expand description
Coordinate in 2D, 3D, or 4D space
Fields§
§x: f64X coordinate (longitude)
y: f64Y coordinate (latitude)
z: Option<f64>Z coordinate (elevation) - optional
m: Option<f64>M coordinate (measure) - optional
Implementations§
Source§impl Coordinate
impl Coordinate
Sourcepub const fn new_2d(x: f64, y: f64) -> Coordinate
pub const fn new_2d(x: f64, y: f64) -> Coordinate
Creates a new 2D coordinate
Sourcepub const fn new_2dm(x: f64, y: f64, m: f64) -> Coordinate
pub const fn new_2dm(x: f64, y: f64, m: f64) -> Coordinate
Creates a new coordinate with measure
Sourcepub const fn new_3dm(x: f64, y: f64, z: f64, m: f64) -> Coordinate
pub const fn new_3dm(x: f64, y: f64, z: f64, m: f64) -> Coordinate
Creates a new 3D coordinate with measure
Sourcepub const fn dimensions(&self) -> u8
pub const fn dimensions(&self) -> u8
Returns the number of dimensions (2, 3, or 4)
Trait Implementations§
Source§impl Clone for Coordinate
impl Clone for Coordinate
Source§fn clone(&self) -> Coordinate
fn clone(&self) -> Coordinate
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 Coordinate
impl Debug for Coordinate
Source§impl<'de> Deserialize<'de> for Coordinate
impl<'de> Deserialize<'de> for Coordinate
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Coordinate, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Coordinate, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for Coordinate
impl PartialEq for Coordinate
Source§impl Serialize for Coordinate
impl Serialize for Coordinate
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for Coordinate
impl StructuralPartialEq for Coordinate
Auto Trait Implementations§
impl Freeze for Coordinate
impl RefUnwindSafe for Coordinate
impl Send for Coordinate
impl Sync for Coordinate
impl Unpin for Coordinate
impl UnsafeUnpin for Coordinate
impl UnwindSafe for Coordinate
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