pub struct BoundingBox {
pub min_lat: f64,
pub min_lon: f64,
pub max_lat: f64,
pub max_lon: f64,
}Expand description
A geographic bounding box for filtering tiles during preload.
Coordinates are in decimal degrees (WGS84).
Fields§
§min_lat: f64Minimum latitude (southern boundary).
min_lon: f64Minimum longitude (western boundary).
max_lat: f64Maximum latitude (northern boundary).
max_lon: f64Maximum longitude (eastern boundary).
Implementations§
Source§impl BoundingBox
impl BoundingBox
Sourcepub fn new(min_lat: f64, min_lon: f64, max_lat: f64, max_lon: f64) -> Self
pub fn new(min_lat: f64, min_lon: f64, max_lat: f64, max_lon: f64) -> Self
Create a new bounding box.
§Arguments
min_lat- Southern boundary latitudemin_lon- Western boundary longitudemax_lat- Northern boundary latitudemax_lon- Eastern boundary longitude
Sourcepub fn overlaps_tile(&self, tile_lat: i32, tile_lon: i32) -> bool
pub fn overlaps_tile(&self, tile_lat: i32, tile_lon: i32) -> bool
Check if this bounding box overlaps with a 1°×1° tile.
A tile at (tile_lat, tile_lon) covers the area
[tile_lat, tile_lat+1) × [tile_lon, tile_lon+1).
Trait Implementations§
Source§impl Clone for BoundingBox
impl Clone for BoundingBox
Source§fn clone(&self) -> BoundingBox
fn clone(&self) -> BoundingBox
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BoundingBox
impl Debug for BoundingBox
impl Copy for BoundingBox
Auto Trait Implementations§
impl Freeze for BoundingBox
impl RefUnwindSafe for BoundingBox
impl Send for BoundingBox
impl Sync for BoundingBox
impl Unpin for BoundingBox
impl UnsafeUnpin for BoundingBox
impl UnwindSafe for BoundingBox
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