Trait geo::algorithm::boundingbox::BoundingBox
[−]
[src]
pub trait BoundingBox<T: Float> { fn bbox(&self) -> Option<Bbox<T>>; }
Calculation of the bounding box of a geometry.
Required Methods
fn bbox(&self) -> Option<Bbox<T>>
Return a 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
impl<T> BoundingBox<T> for MultiPoint<T> where T: Float
impl<T> BoundingBox<T> for LineString<T> where T: Float
impl<T> BoundingBox<T> for MultiLineString<T> where T: Float
impl<T> BoundingBox<T> for Polygon<T> where T: Float
impl<T> BoundingBox<T> for MultiPolygon<T> where T: Float