Trait geo::algorithm::boundingbox::BoundingBox [] [src]

pub trait BoundingBox<T: Float> {
    type Output;
    fn bbox(&self) -> Self::Output;
}

Calculation of the bounding box of a geometry.

Associated Types

Required Methods

Return the Bounding Box of a geometry

use geo::{Point, LineString};
use geo::algorithm::boundingbox::BoundingBox;

let mut vec = Vec::new();
vec.push(Point::new(40.02f64, 116.34));
vec.push(Point::new(42.02f64, 116.34));
vec.push(Point::new(42.02f64, 118.34));
let linestring = LineString(vec);
let bbox = linestring.bbox().unwrap();

assert_eq!(40.02f64, bbox.xmin);
assert_eq!(42.02f64, bbox.xmax);
assert_eq!(116.34, bbox.ymin);
assert_eq!(118.34, bbox.ymax);

Implementors