[][src]Struct slippy_map_tiles::BBox

pub struct BBox { /* fields omitted */ }

A Bounding box

Implementations

impl BBox[src]

pub fn new(top: f32, left: f32, bottom: f32, right: f32) -> Option<BBox>[src]

Construct a new BBox from the given max and min latitude and longitude. Returns None if the lat or lon is invalid, e.g. a lon of 200

pub fn new_from_points(topleft: &LatLon, bottomright: &LatLon) -> BBox[src]

Given two points, return the bounding box specified by those 2 points

pub fn new_from_tile(tile: &Tile) -> Self[src]

Construct a BBox from a tile

pub fn contains_point(&self, point: &LatLon) -> bool[src]

Return true iff this point is in this bbox

pub fn overlaps_bbox(&self, other: &BBox) -> bool[src]

Returns true iff this bbox and other share at least one point

pub fn tiles(&self) -> BBoxTilesIterator<'_>

Notable traits for BBoxTilesIterator<'a>

impl<'a> Iterator for BBoxTilesIterator<'a> type Item = Tile;
[src]

Iterate over all the tiles from z0 onwards that this bbox is in

pub fn metatiles(&self, scale: u8) -> MetatilesIterator

Notable traits for MetatilesIterator

impl Iterator for MetatilesIterator type Item = Metatile;
[src]

Iterate over all the metatiles from z0 onwards that this bbox is in

pub fn top(&self) -> f32[src]

Return the top value of this bbox

pub fn bottom(&self) -> f32[src]

Return the bottom value of this bbox

pub fn left(&self) -> f32[src]

Return the left value of this bbox

pub fn right(&self) -> f32[src]

Return the right value of this bbox

pub fn tiles_for_zoom(&self, zoom: u8) -> impl Iterator<Item = Tile>[src]

For this zoom level, return all the tiles that cover this bbox

pub fn centre_point(&self) -> LatLon[src]

Returns the LatLon for the centre of this bbox

pub fn center_point(&self) -> LatLon[src]

Returns the LatLon for the centre of this bbox

pub fn nw_corner(&self) -> LatLon[src]

Returns the LatLon of the top left, i.e. north west corner, of this bbot

pub fn ne_corner(&self) -> LatLon[src]

Returns the LatLon of the top right, i.e. north east corner, of this bbox

pub fn sw_corner(&self) -> LatLon[src]

Returns the LatLon of the bottom left, i.e. south west corner, of this bbox

pub fn se_corner(&self) -> LatLon[src]

Returns the LatLon of the bottom right, i.e. south east corner, of this bbox.

Trait Implementations

impl Clone for BBox[src]

impl Debug for BBox[src]

impl FromStr for BBox[src]

type Err = &'static str

The associated error which can be returned from parsing.

fn from_str(string: &str) -> Result<Self, Self::Err>[src]

Given a string like "$MINLON $MINLAT $MAXLON $MAXLAT" parse that into a BBox. Returns None if there is no match.

impl PartialEq<BBox> for BBox[src]

impl StructuralPartialEq for BBox[src]

Auto Trait Implementations

impl RefUnwindSafe for BBox

impl Send for BBox

impl Sync for BBox

impl Unpin for BBox

impl UnwindSafe for BBox

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.