Trait geo::algorithm::extremes::ExtremePoints [] [src]

pub trait ExtremePoints<T: Float> {
    fn extreme_points(&self) -> ExtremePoint<T>;
}

Required Methods

Find the extreme x and y points of a Geometry

This trait is available to any struct implementing both ConvexHull amd ExtremeIndices

use geo::{Point, LineString, Polygon};
use geo::extremes::ExtremePoints;
let points_raw = vec![(1.0, 0.0), (2.0, 1.0), (1.0, 2.0), (0.0, 1.0), (1.0, 0.0)];
let points = points_raw
    .iter()
    .map(|e| Point::new(e.0, e.1))
    .collect::<Vec<_>>();
let poly1 = Polygon::new(LineString(points), vec![]);
let extremes = poly1.extreme_points();
let correct = Point::new(0.0, 1.0);
assert_eq!(extremes.xmin, correct);

Implementors