[−][src]Struct vadeen_osm::geo::Coordinate
Represents a coordinate containing latitude and longitude.
Coordinates are usually represented by floating point numbers, for coordinates in the osm system
we do not need more precision than 7 decimals as can be read in the o5m
documentation.
The coordinates are represented as two i32 internally.
Examples
let coordinate = Coordinate::new(70.95, -8.67); // Get decimal numbers assert_eq!(coordinate.lat(), 70.95); assert_eq!(coordinate.lon(), -8.67); // Access internal i32 numbers assert_eq!(coordinate.lat, 709500000); assert_eq!(coordinate.lon, -86700000); // You can also use the `Into` trait to construct coordinates. let coordinate: Coordinate = (70.95, -8.67).into();
Fields
lat: i32
lon: i32
Methods
impl Coordinate
[src]
pub fn new(lat: f64, lon: f64) -> Coordinate
[src]
pub fn lat(self) -> f64
[src]
pub fn lon(self) -> f64
[src]
Trait Implementations
impl Add<Coordinate> for Coordinate
[src]
type Output = Coordinate
The resulting type after applying the +
operator.
fn add(self, rhs: Self) -> Self::Output
[src]
impl Clone for Coordinate
[src]
fn clone(&self) -> Coordinate
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for Coordinate
[src]
impl Debug for Coordinate
[src]
impl Eq for Coordinate
[src]
impl From<(f64, f64)> for Coordinate
[src]
impl Hash for Coordinate
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Coordinate> for Coordinate
[src]
fn eq(&self, other: &Coordinate) -> bool
[src]
fn ne(&self, other: &Coordinate) -> bool
[src]
impl StructuralEq for Coordinate
[src]
impl StructuralPartialEq for Coordinate
[src]
impl Sub<Coordinate> for Coordinate
[src]
type Output = Coordinate
The resulting type after applying the -
operator.
fn sub(self, rhs: Self) -> Self::Output
[src]
Auto Trait Implementations
impl RefUnwindSafe for Coordinate
impl Send for Coordinate
impl Sync for Coordinate
impl Unpin for Coordinate
impl UnwindSafe for Coordinate
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,