pub struct BoundingBox {
pub xmin: f64,
pub ymin: f64,
pub xmax: f64,
pub ymax: f64,
}
Expand description
Defines a bounding box by its coordinate boundaries (in radians)
Fields§
§xmin: f64
§ymin: f64
§xmax: f64
§ymax: f64
Implementations§
Source§impl<'a> BoundingBox
impl<'a> BoundingBox
Sourcepub fn from_point(lat: f64, lon: f64, dkm: f64) -> Self
pub fn from_point(lat: f64, lon: f64, dkm: f64) -> Self
Construct a bounding box dist dkm away from point
Sourcepub async fn search(&self, config: &Config) -> Result<OverpassResponse, Error>
pub async fn search(&self, config: &Config) -> Result<OverpassResponse, Error>
Asynchronously search for nodes within the bounding box by tag
§Example
use osm_rs::overpass::{BoundingBox, Config};
#[tokio::main]
async fn main() {
let c: Config = Config {
url: "https://overpass-api.de/api/interpreter".to_string(),
timeout: 25,
key: "amenity".to_string(),
val: "cafe".to_string(),
};
let b: BoundingBox = BoundingBox {
xmin: 51.305219521963295,
ymin: -0.7690429687500001,
xmax: 51.82219818336938,
ymax: 0.5273437500000064,
};
let resp = b.search(&c).await.expect("failed query");
}
Trait Implementations§
Source§impl Clone for BoundingBox
impl Clone for BoundingBox
Source§fn clone(&self) -> BoundingBox
fn clone(&self) -> BoundingBox
Returns a copy 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
Source§impl<'de> Deserialize<'de> for BoundingBox
impl<'de> Deserialize<'de> for BoundingBox
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
Auto Trait Implementations§
impl Freeze for BoundingBox
impl RefUnwindSafe for BoundingBox
impl Send for BoundingBox
impl Sync for BoundingBox
impl Unpin 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