[][src]Trait geo::algorithm::bounding_rect::BoundingRect

pub trait BoundingRect<T: CoordinateType> {
    type Output;
    fn bounding_rect(&self) -> Self::Output;
}

Calculation of the bounding rectangle of a geometry.

Associated Types

type Output

Loading content...

Required methods

fn bounding_rect(&self) -> Self::Output

Return the bounding rectangle of a geometry

Examples

use geo::{Point, LineString};
use geo::algorithm::bounding_rect::BoundingRect;

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::from(vec);
let bounding_rect = linestring.bounding_rect().unwrap();

assert_eq!(40.02f64, bounding_rect.min.x);
assert_eq!(42.02f64, bounding_rect.max.x);
assert_eq!(116.34, bounding_rect.min.y);
assert_eq!(118.34, bounding_rect.max.y);
Loading content...

Implementors

impl<T> BoundingRect<T> for Line<T> where
    T: CoordinateType
[src]

type Output = Rect<T>

impl<T> BoundingRect<T> for LineString<T> where
    T: CoordinateType
[src]

type Output = Option<Rect<T>>

fn bounding_rect(&self) -> Self::Output[src]

Return the BoundingRect for a LineString

impl<T> BoundingRect<T> for MultiLineString<T> where
    T: CoordinateType
[src]

type Output = Option<Rect<T>>

fn bounding_rect(&self) -> Self::Output[src]

Return the BoundingRect for a MultiLineString

impl<T> BoundingRect<T> for MultiPoint<T> where
    T: CoordinateType
[src]

type Output = Option<Rect<T>>

fn bounding_rect(&self) -> Self::Output[src]

Return the BoundingRect for a MultiPoint

impl<T> BoundingRect<T> for MultiPolygon<T> where
    T: CoordinateType
[src]

type Output = Option<Rect<T>>

fn bounding_rect(&self) -> Self::Output[src]

Return the BoundingRect for a MultiPolygon

impl<T> BoundingRect<T> for Polygon<T> where
    T: CoordinateType
[src]

type Output = Option<Rect<T>>

fn bounding_rect(&self) -> Self::Output[src]

Return the BoundingRect for a Polygon

impl<T> BoundingRect<T> for Triangle<T> where
    T: CoordinateType
[src]

type Output = Rect<T>

Loading content...