logo
pub trait BoundingRect<T: CoordNum> {
    type Output;

    fn bounding_rect(&self) -> Self::Output;
}
Expand description

Calculation of the bounding rectangle of a geometry.

Required Associated Types

Required Methods

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);

Implementors