pub struct BBox<T = f64> {
pub left: T,
pub bottom: T,
pub right: T,
pub top: T,
}Expand description
A BBOX is defined in lon-lat space and helps with zooming motion to see the entire line or polygon The order is (left, bottom, right, top) If WM, then the projection is lon-lat If S2, then the projection is s-t
Fields§
§left: Tleft most longitude (WM) or S (S2)
bottom: Tbottom most latitude (WM) or T (S2)
right: Tright most longitude (WM) or T (S2)
top: Ttop most latitude (WM) or S (S2)
Implementations§
Source§impl<T> BBox<T>
impl<T> BBox<T>
Sourcepub fn point_overlap<M>(&self, point: VectorPoint<M>) -> bool
pub fn point_overlap<M>(&self, point: VectorPoint<M>) -> bool
Checks if a point is within the BBox
Sourcepub fn merge(&self, other: &BBox<T>) -> BBox<T>where
T: PartialOrd + Copy,
pub fn merge(&self, other: &BBox<T>) -> BBox<T>where
T: PartialOrd + Copy,
Merges another bounding box with this one
Sourcepub fn merge_in_place(&mut self, other: &BBox<T>)where
T: PartialOrd + Copy,
pub fn merge_in_place(&mut self, other: &BBox<T>)where
T: PartialOrd + Copy,
Merges in place another bounding box with this one
Source§impl BBox
impl BBox
Sourcepub fn from_point<M>(point: &VectorPoint<M>) -> BBoxwhere
M: Clone,
pub fn from_point<M>(point: &VectorPoint<M>) -> BBoxwhere
M: Clone,
Creates a new BBox from a point
Sourcepub fn from_linestring<M>(line: &Vec<VectorPoint<M>>) -> BBoxwhere
M: Clone,
pub fn from_linestring<M>(line: &Vec<VectorPoint<M>>) -> BBoxwhere
M: Clone,
Creates a new BBox from a linestring
Sourcepub fn from_multi_linestring<M>(lines: &Vec<Vec<VectorPoint<M>>>) -> BBoxwhere
M: Clone,
pub fn from_multi_linestring<M>(lines: &Vec<Vec<VectorPoint<M>>>) -> BBoxwhere
M: Clone,
Creates a new BBox from a multi-linestring
Sourcepub fn from_polygon<M>(polygon: &Vec<Vec<VectorPoint<M>>>) -> BBoxwhere
M: Clone,
pub fn from_polygon<M>(polygon: &Vec<Vec<VectorPoint<M>>>) -> BBoxwhere
M: Clone,
Creates a new BBox from a polygon
Sourcepub fn from_multi_polygon<M>(polygons: &Vec<Vec<Vec<VectorPoint<M>>>>) -> BBoxwhere
M: Clone,
pub fn from_multi_polygon<M>(polygons: &Vec<Vec<Vec<VectorPoint<M>>>>) -> BBoxwhere
M: Clone,
Creates a new BBox from a multi-polygon
Sourcepub fn extend_from_point<M>(&mut self, point: &VectorPoint<M>)where
M: Clone,
pub fn extend_from_point<M>(&mut self, point: &VectorPoint<M>)where
M: Clone,
Extends the bounding box with a point
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for BBox<T>where
T: Deserialize<'de> + Copy,
impl<'de, T> Deserialize<'de> for BBox<T>where
T: Deserialize<'de> + Copy,
Source§fn deserialize<D>(
deserializer: D,
) -> Result<BBox<T>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<BBox<T>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> PartialOrd for BBox<T>where
T: PartialOrd,
impl<T> PartialOrd for BBox<T>where
T: PartialOrd,
Source§impl<T> Serialize for BBox<T>
impl<T> Serialize for BBox<T>
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<T> Copy for BBox<T>where
T: Copy,
impl<T> MValueCompatible for BBox<T>
impl<T> StructuralPartialEq for BBox<T>
Auto Trait Implementations§
impl<T> Freeze for BBox<T>where
T: Freeze,
impl<T> RefUnwindSafe for BBox<T>where
T: RefUnwindSafe,
impl<T> Send for BBox<T>where
T: Send,
impl<T> Sync for BBox<T>where
T: Sync,
impl<T> Unpin for BBox<T>where
T: Unpin,
impl<T> UnwindSafe for BBox<T>where
T: UnwindSafe,
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