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: Clone>(&self, point: VectorPoint<M>) -> bool
 
pub fn point_overlap<M: Clone>(&self, point: VectorPoint<M>) -> bool
Checks if a point is within the BBox
Sourcepub fn merge(&self, other: &Self) -> Selfwhere
    T: PartialOrd + Copy,
 
pub fn merge(&self, other: &Self) -> Selfwhere
    T: PartialOrd + Copy,
Merges another bounding box with this one
Sourcepub fn merge_in_place(&mut self, other: &Self)where
    T: PartialOrd + Copy,
 
pub fn merge_in_place(&mut self, other: &Self)where
    T: PartialOrd + Copy,
Merges in place another bounding box with this one
Source§impl BBox<f64>
 
impl BBox<f64>
Sourcepub fn from_point<M: Clone>(point: &VectorPoint<M>) -> Self
 
pub fn from_point<M: Clone>(point: &VectorPoint<M>) -> Self
Creates a new BBox from a point
Sourcepub fn from_linestring<M: Clone>(line: &VectorLineString<M>) -> Self
 
pub fn from_linestring<M: Clone>(line: &VectorLineString<M>) -> Self
Creates a new BBox from a linestring
Sourcepub fn from_multi_linestring<M: Clone>(lines: &VectorMultiLineString<M>) -> Self
 
pub fn from_multi_linestring<M: Clone>(lines: &VectorMultiLineString<M>) -> Self
Creates a new BBox from a multi-linestring
Sourcepub fn from_polygon<M: Clone>(polygon: &VectorPolygon<M>) -> Self
 
pub fn from_polygon<M: Clone>(polygon: &VectorPolygon<M>) -> Self
Creates a new BBox from a polygon
Sourcepub fn from_multi_polygon<M: Clone>(polygons: &VectorMultiPolygon<M>) -> Self
 
pub fn from_multi_polygon<M: Clone>(polygons: &VectorMultiPolygon<M>) -> Self
Creates a new BBox from a multi-polygon
Sourcepub fn extend_from_point<M: Clone>(&mut self, point: &VectorPoint<M>)
 
pub fn extend_from_point<M: Clone>(&mut self, point: &VectorPoint<M>)
Extends the bounding box with a point
Sourcepub fn from_uv_zoom(u: f64, v: f64, zoom: u8) -> Self
 
pub fn from_uv_zoom(u: f64, v: f64, zoom: u8) -> Self
Creates a new BBox from zoom-uv coordinates
Sourcepub fn from_st_zoom(s: f64, t: f64, zoom: u8) -> Self
 
pub fn from_st_zoom(s: f64, t: f64, zoom: u8) -> Self
Creates a new BBox from zoom-st coordinates