Struct rsgeo::prelude::RecArea[][src]

pub struct RecArea { /* fields omitted */ }

represent a rectangle area

Implementations

impl RecArea[src]

pub fn new(
    min_lat: f32,
    max_lat: f32,
    min_long: f32,
    max_long: f32
) -> Result<Self, &'static str>
[src]

Create a new RecArea.The latitude and longitude should be valid,otherwise.

Trait Implementations

impl Area for RecArea[src]

fn contains(&self, p: &Point) -> bool[src]

judge if a point in a rectangle area

Example

use rsgeo::prelude::{RecArea,Point,Area};
let ra = RecArea::new(35.0, 36.0, 110.0, 115.0).unwrap();
let pa = Point::new(32.0,112.0).unwrap();
let pb = Point::new(35.1,112.0).unwrap();
assert!(!ra.contains(&pa));
assert!(ra.contains(&pb));

impl Debug for RecArea[src]

Auto Trait Implementations

impl RefUnwindSafe for RecArea

impl Send for RecArea

impl Sync for RecArea

impl Unpin for RecArea

impl UnwindSafe for RecArea

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, 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.