[][src]Trait geo::algorithm::vincenty_length::VincentyLength

pub trait VincentyLength<T, RHS = Self> {
    fn vincenty_length(&self) -> Result<T, FailedToConvergeError>;
}

Determine the length of a geometries using Vincenty’s formulae.

Required methods

fn vincenty_length(&self) -> Result<T, FailedToConvergeError>

Determine the length of a geometries using Vincenty’s formulae.

Units

  • return value: meters

Examples

use geo::LineString;
use geo::prelude::*;

let linestring = LineString::<f64>::from(vec![
  // New York City
  (-74.006, 40.7128),
  // London
  (-0.1278, 51.5074),
]);

let length = linestring.vincenty_length().unwrap();

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

Implementors

impl<T> VincentyLength<T, Line<T>> for Line<T> where
    T: Float + FromPrimitive
[src]

fn vincenty_length(&self) -> Result<T, FailedToConvergeError>[src]

The units of the returned value is meters.

impl<T> VincentyLength<T, LineString<T>> for LineString<T> where
    T: Float + FromPrimitive
[src]

impl<T> VincentyLength<T, MultiLineString<T>> for MultiLineString<T> where
    T: Float + FromPrimitive
[src]

Loading content...