pub trait RhumbDistance<T, Rhs = Self> {
// Required method
fn rhumb_distance(&self, rhs: &Rhs) -> T;
}
👎Deprecated since 0.29.0: Please use the
Rhumb.distance
method from the Distance
trait insteadExpand description
Determine the distance between two geometries along a rhumb line.
Note: this implementation uses a mean earth radius of 6371.088 km, based on the recommendation of the IUGG
Required Methods§
Sourcefn rhumb_distance(&self, rhs: &Rhs) -> T
👎Deprecated since 0.29.0: Please use the Rhumb.distance
method from the Distance
trait instead
fn rhumb_distance(&self, rhs: &Rhs) -> T
Rhumb.distance
method from the Distance
trait insteadDetermine the distance between along the rhumb line between two geometries.
§Units
- return value: meters
§Examples
use geo::prelude::*;
use geo::point;
// New York City
let p1 = point!(x: -74.006f64, y: 40.7128f64);
// London
let p2 = point!(x: -0.1278f64, y: 51.5074f64);
let distance = p1.rhumb_distance(&p2);
assert_eq!(
5_794_129., // meters
distance.round()
);