[][src]Trait geo::algorithm::contains::Contains

pub trait Contains<Rhs = Self> {
    fn contains(&self, rhs: &Rhs) -> bool;
}

Checks if the geometry A is completely inside the B geometry

Required methods

fn contains(&self, rhs: &Rhs) -> bool

Checks if rhs is completely contained within self.

Examples

use geo::{Coordinate, Point, LineString, Polygon};
use geo::algorithm::contains::Contains;

let linestring = LineString::from(vec![(0., 0.), (2., 0.), (2., 2.), (0., 2.), (0., 0.)]);
let poly = Polygon::new(linestring.clone(), vec![]);

//Point in Point
assert!(Point::new(2., 0.).contains(&Point::new(2., 0.)));

//Point in Linestring
assert!(linestring.contains(&Point::new(2., 0.)));

//Point in Polygon
assert!(poly.contains(&Point::new(1., 1.)));
Loading content...

Implementors

impl<T> Contains<Line<T>> for Line<T> where
    T: Float
[src]

impl<T> Contains<Line<T>> for LineString<T> where
    T: Float
[src]

impl<T> Contains<Line<T>> for Polygon<T> where
    T: Float
[src]

impl<T> Contains<LineString<T>> for Line<T> where
    T: Float
[src]

impl<T> Contains<LineString<T>> for Polygon<T> where
    T: Float
[src]

impl<T> Contains<Point<T>> for Line<T> where
    T: Float
[src]

impl<T> Contains<Point<T>> for LineString<T> where
    T: Float
[src]

impl<T> Contains<Point<T>> for MultiPolygon<T> where
    T: Float
[src]

impl<T> Contains<Point<T>> for Point<T> where
    T: Float
[src]

impl<T> Contains<Point<T>> for Polygon<T> where
    T: Float
[src]

impl<T> Contains<Point<T>> for Rect<T> where
    T: CoordinateType
[src]

impl<T> Contains<Point<T>> for Triangle<T> where
    T: CoordinateType
[src]

impl<T> Contains<Polygon<T>> for Polygon<T> where
    T: Float
[src]

impl<T> Contains<Rect<T>> for Rect<T> where
    T: CoordinateType
[src]

Loading content...