pub struct BoundingBox { /* private fields */ }Expand description
Bounding box of a Zerometry.
The bounding box is a rectangle that contains the Zerometry. It is represented by two coordinates: the bottom-left and top-right corners.
The coordinates are stored in a Coords struct, which is a slice of f64 values.
The first coordinate is the bottom-left corner, and the second coordinate is the top-right corner.
Implementations§
Source§impl BoundingBox
impl BoundingBox
Sourcepub unsafe fn from_bytes(data: &[u8]) -> &Self
pub unsafe fn from_bytes(data: &[u8]) -> &Self
§Safety
The data must be generated from the Self::write_from_geometry method and be aligned on 64 bits
Sourcepub unsafe fn from_slice(data: &[f64]) -> &Self
pub unsafe fn from_slice(data: &[f64]) -> &Self
Create the bounding box from a slice of f64
§Safety
The data must be generated from the Self::write_from_geometry method and be aligned on 64 bits
Sourcepub unsafe fn from_slice_mut(data: &mut [f64]) -> &mut Self
pub unsafe fn from_slice_mut(data: &mut [f64]) -> &mut Self
§Safety
The data must be generated from the Self::write_from_geometry method and be aligned on 64 bits
Sourcepub unsafe fn from_coords(coords: &Coords) -> &Self
pub unsafe fn from_coords(coords: &Coords) -> &Self
§Safety
The Coords must:
- Contains at least two elements
- Be aligned on 64 bits
- Have it’s first coordinate smaller than the second one
Sourcepub unsafe fn from_coords_mut(coords: &mut Coords) -> &mut Self
pub unsafe fn from_coords_mut(coords: &mut Coords) -> &mut Self
§Safety
The Coords must:
- Contains at least two elements
- Be aligned on 64 bits
- Have it’s first coordinate smaller than the second one
Sourcepub fn write_from_geometry(
writer: &mut impl Write,
points: impl Iterator<Item = Point<f64>>,
) -> Result<(), Error>
pub fn write_from_geometry( writer: &mut impl Write, points: impl Iterator<Item = Point<f64>>, ) -> Result<(), Error>
Write the bounding boxe that contains all the specified points to a buffer.
Sourcepub fn bottom_left(&self) -> &Coord
pub fn bottom_left(&self) -> &Coord
Return the bottom left coord
Sourcepub fn horizontal_range(&self) -> RangeInclusive<f64>
pub fn horizontal_range(&self) -> RangeInclusive<f64>
Return the longitude range contained in the bounding box
Sourcepub fn vertical_range(&self) -> RangeInclusive<f64>
pub fn vertical_range(&self) -> RangeInclusive<f64>
Return the latitude range contained in the bounding box
Sourcepub fn contains_coord(&self, coord: &Coord) -> bool
pub fn contains_coord(&self, coord: &Coord) -> bool
Return true if the coord is contained in the bounding box
Sourcepub fn to_geo(&self) -> Rect<f64>
pub fn to_geo(&self) -> Rect<f64>
Convert the bounding box to a geo_types::Rect.
Note: Converting that back to a crate::Zerometry will produce a crate::Zolygon
Trait Implementations§
Source§impl Debug for BoundingBox
impl Debug for BoundingBox
Source§impl RelationBetweenShapes<BoundingBox> for BoundingBox
impl RelationBetweenShapes<BoundingBox> for BoundingBox
Source§fn relation(
&self,
other: &BoundingBox,
relation: InputRelation,
) -> OutputRelation
fn relation( &self, other: &BoundingBox, relation: InputRelation, ) -> OutputRelation
InputRelation lets you specify the kind of relation you want to retrieve. Read moreSource§fn all_relation(&self, other: &Other) -> OutputRelation
fn all_relation(&self, other: &Other) -> OutputRelation
Source§fn any_relation(&self, other: &Other) -> OutputRelation
fn any_relation(&self, other: &Other) -> OutputRelation
Source§fn strict_contains(&self, other: &Other) -> bool
fn strict_contains(&self, other: &Other) -> bool
true if Self strictly contains Other.Source§fn strict_contained(&self, other: &Other) -> bool
fn strict_contained(&self, other: &Other) -> bool
true if Self is strictly contained in Other.Source§fn intersects(&self, other: &Other) -> bool
fn intersects(&self, other: &Other) -> bool
true if Self intersects with Other.Source§impl RelationBetweenShapes<Coord> for BoundingBox
impl RelationBetweenShapes<Coord> for BoundingBox
Source§fn relation(&self, other: &Coord, relation: InputRelation) -> OutputRelation
fn relation(&self, other: &Coord, relation: InputRelation) -> OutputRelation
InputRelation lets you specify the kind of relation you want to retrieve. Read moreSource§fn all_relation(&self, other: &Other) -> OutputRelation
fn all_relation(&self, other: &Other) -> OutputRelation
Source§fn any_relation(&self, other: &Other) -> OutputRelation
fn any_relation(&self, other: &Other) -> OutputRelation
Source§fn strict_contains(&self, other: &Other) -> bool
fn strict_contains(&self, other: &Other) -> bool
true if Self strictly contains Other.Source§fn strict_contained(&self, other: &Other) -> bool
fn strict_contained(&self, other: &Other) -> bool
true if Self is strictly contained in Other.Source§fn intersects(&self, other: &Other) -> bool
fn intersects(&self, other: &Other) -> bool
true if Self intersects with Other.