Struct google_geocoding::Coordinates [−][src]
pub struct Coordinates(_);
WGS-84 coordinates that support serializing and deserializing
Methods
impl Coordinates
[src]
impl Coordinates
pub fn map<__SHRINKWRAP_T, __SHRINKWRAP_F: FnMut(WGS84<f64>) -> __SHRINKWRAP_T>(
self,
f: __SHRINKWRAP_F
) -> __SHRINKWRAP_T
[src]
pub fn map<__SHRINKWRAP_T, __SHRINKWRAP_F: FnMut(WGS84<f64>) -> __SHRINKWRAP_T>(
self,
f: __SHRINKWRAP_F
) -> __SHRINKWRAP_T
Map a function over the wrapped value, consuming it in the process.
pub fn map_ref<__SHRINKWRAP_T, __SHRINKWRAP_F: FnMut(&WGS84<f64>) -> __SHRINKWRAP_T>(
&self,
f: __SHRINKWRAP_F
) -> __SHRINKWRAP_T
[src]
pub fn map_ref<__SHRINKWRAP_T, __SHRINKWRAP_F: FnMut(&WGS84<f64>) -> __SHRINKWRAP_T>(
&self,
f: __SHRINKWRAP_F
) -> __SHRINKWRAP_T
Map a function over the wrapped value without consuming it.
Methods from Deref<Target = WGS84<f64>>
pub fn latitude_degrees(&self) -> N
[src]
pub fn latitude_degrees(&self) -> N
Get latitude of position, in degrees
pub fn longitude_degrees(&self) -> N
[src]
pub fn longitude_degrees(&self) -> N
Get longitude of position, in degrees
pub fn distance(&self, other: &WGS84<N>) -> N
[src]
pub fn distance(&self, other: &WGS84<N>) -> N
Distance between two WGS84 positions
This function uses the haversin formula to calculate the distance between two positions. For more control convert to ECEF and calculate the difference.
Examples
use nav_types::WGS84; let oslo = WGS84::new(59.95, 10.75, 0.0); let stockholm = WGS84::new(59.329444, 18.068611, 0.0); println!("Great circle distance between Oslo and Stockholm: {:?}", oslo.distance(&stockholm));
pub fn altitude(&self) -> N
[src]
pub fn altitude(&self) -> N
Get altitude of position
pub fn latitude(&self) -> N
[src]
pub fn latitude(&self) -> N
Get latitude in radians
pub fn longitude(&self) -> N
[src]
pub fn longitude(&self) -> N
Get longitude in radians
Trait Implementations
impl Clone for Coordinates
[src]
impl Clone for Coordinates
fn clone(&self) -> Coordinates
[src]
fn clone(&self) -> Coordinates
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Copy for Coordinates
[src]
impl Copy for Coordinates
impl Debug for Coordinates
[src]
impl Debug for Coordinates
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Deref for Coordinates
[src]
impl Deref for Coordinates
type Target = WGS84<f64>
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
fn deref(&self) -> &Self::Target
Dereferences the value.
impl Borrow<WGS84<f64>> for Coordinates
[src]
impl Borrow<WGS84<f64>> for Coordinates
impl AsRef<WGS84<f64>> for Coordinates
[src]
impl AsRef<WGS84<f64>> for Coordinates
impl<'de> Deserialize<'de> for Coordinates
[src]
impl<'de> Deserialize<'de> for Coordinates
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Serialize for Coordinates
[src]
impl Serialize for Coordinates
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
[src]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Display for Coordinates
[src]
impl Display for Coordinates
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl From<WGS84<f64>> for Coordinates
[src]
impl From<WGS84<f64>> for Coordinates
Auto Trait Implementations
impl Send for Coordinates
impl Send for Coordinates
impl Sync for Coordinates
impl Sync for Coordinates