pub struct Polygon { /* private fields */ }Expand description
A polygon with a bounding box.
This struct implements From<geoo:Polygon>, so for GIS applications you can instantiate this
from any geo::Polygon.
Implementations§
Source§impl Polygon
impl Polygon
Sourcepub fn new(bounds: [(f32, f32); 2], points: Vec<(f32, f32)>) -> Polygon
pub fn new(bounds: [(f32, f32); 2], points: Vec<(f32, f32)>) -> Polygon
Construct a Polygon from a bounding-box and set of points.
bounds should be [(min_x, max_x), (min_y, max_y)].
points should be an exterior ring concatenated with a (possibly empty) set of interior
rings, where a “ring” is a list of points where the first and last point are equal.
The exterior ring of points should be positively oriented, i.e. it should go in
counter-clockwise order. The interior rings should be negatively oriented.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Polygon
impl RefUnwindSafe for Polygon
impl Send for Polygon
impl Sync for Polygon
impl Unpin for Polygon
impl UnwindSafe for Polygon
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.