Trait geo::algorithm::contains::Contains
[−]
[src]
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 the geometry A is completely inside the B geometry.
use geo::{Coordinate, Point, LineString, Polygon}; use geo::algorithm::contains::Contains; let p = |x, y| Point(Coordinate { x: x, y: y }); let v = Vec::new(); let linestring = LineString(vec![p(0., 0.), p(2., 0.), p(2., 2.), p(0., 2.), p(0., 0.)]); let poly = Polygon::new(linestring.clone(), v); //Point in Point assert!(p(2., 0.).contains(&p(2., 0.))); //Point in Linestring assert!(linestring.contains(&p(2., 0.))); //Point in Polygon assert!(poly.contains(&p(1., 1.)));
Implementors
impl<T> Contains<Point<T>> for Point<T> where T: Float + ToPrimitive
impl<T> Contains<Point<T>> for LineString<T> where T: Float
impl<T> Contains<Point<T>> for geo::Polygon<T> where T: Float
impl<T> Contains<Point<T>> for MultiPolygon<T> where T: Float
impl<T> Contains<LineString<T>> for geo::Polygon<T> where T: Float
impl<T> Contains<Bbox<T>> for Bbox<T> where T: Float