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

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

Calculation of the bounding rectangle of a geometry.

Associated Types

Loading content...

Required methods

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

Return the bounding rectangle of a geometry

Examples

use geo::algorithm::bounding_rect::BoundingRect;
use geo::line_string;

let line_string = line_string![
    (x: 40.02f64, y: 116.34),
    (x: 42.02f64, y: 116.34),
    (x: 42.02f64, y: 118.34),
];

let bounding_rect = line_string.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 Geometry<T> where
    T: CoordNum
[src]

type Output = Option<Rect<T>>

impl<T> BoundingRect<T> for GeometryCollection<T> where
    T: CoordNum
[src]

type Output = Option<Rect<T>>

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

type Output = Rect<T>

impl<T> BoundingRect<T> for LineString<T> where
    T: CoordNum
[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: CoordNum
[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: CoordNum
[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: CoordNum
[src]

type Output = Option<Rect<T>>

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

Return the BoundingRect for a MultiPolygon

impl<T> BoundingRect<T> for Point<T> where
    T: CoordNum
[src]

type Output = Rect<T>

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

Return the bounding rectangle for a Point. It will have zero width and zero height.

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

type Output = Option<Rect<T>>

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

Return the BoundingRect for a Polygon

impl<T> BoundingRect<T> for Rect<T> where
    T: CoordNum
[src]

type Output = Rect<T>

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

type Output = Rect<T>

Loading content...