[][src]Trait geo::algorithm::vincenty_distance::VincentyDistance

pub trait VincentyDistance<T, Rhs = Self> {
    fn vincenty_distance(&self, rhs: &Rhs) -> Result<T, FailedToConvergeError>;
}

Determine the distance between two geometries using Vincenty’s formulae.

Required methods

fn vincenty_distance(&self, rhs: &Rhs) -> Result<T, FailedToConvergeError>

Determine the distance between two geometries using Vincenty’s formulae.

Units

  • return value: meters

Examples

use geo::prelude::*;
use geo::Point;

// New York City
let p1 = Point::<f64>::from((-74.006, 40.7128));
// London
let p2 = Point::<f64>::from((-0.1278, 51.5074));

let distance = p1.vincenty_distance(&p2).unwrap();

assert_eq!(
    5_585_234., // meters
    distance.round()
);
Loading content...

Implementors

impl<T> VincentyDistance<T, Point<T>> for Point<T> where
    T: Float + FromPrimitive
[src]

Loading content...