pub struct BBox {
pub min_lon: f64,
pub min_lat: f64,
pub max_lon: f64,
pub max_lat: f64,
}Expand description
Data type for a 2D bounding box.
Fields§
§min_lon: f64Minimum longitude or x coordinate.
min_lat: f64Minimum latitude or y coordinate.
max_lon: f64Maximum longitude or x coordinate.
max_lat: f64Maximum latitude or y coordinate.
Implementations§
Source§impl BBox
impl BBox
Sourcepub fn new(values: [f64; 4]) -> Result<Self>
pub fn new(values: [f64; 4]) -> Result<Self>
Creates a new value from [min_lon, min_lat, max_lon, max_lat].
Sourcepub fn validate_geographic(self) -> Result<()>
pub fn validate_geographic(self) -> Result<()>
Validates this value as a longitude/latitude bounding box.
Sourcepub fn contains(self, coordinate: Coordinate) -> bool
pub fn contains(self, coordinate: Coordinate) -> bool
Returns true when this bbox contains a coordinate.
Sourcepub fn intersects_coordinates(self, coordinates: &[Coordinate]) -> bool
pub fn intersects_coordinates(self, coordinates: &[Coordinate]) -> bool
Returns true when this bbox contains at least one coordinate.
Sourcepub fn intersects_geometry(self, geometry: &Geometry) -> bool
pub fn intersects_geometry(self, geometry: &Geometry) -> bool
Returns true when this bbox intersects a geometry.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BBox
impl<'de> Deserialize<'de> for BBox
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for BBox
impl StructuralPartialEq for BBox
Auto Trait Implementations§
impl Freeze for BBox
impl RefUnwindSafe for BBox
impl Send for BBox
impl Sync for BBox
impl Unpin for BBox
impl UnsafeUnpin for BBox
impl UnwindSafe for BBox
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