[][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::algorithm::contains::Contains;
use geo::{line_string, point, Polygon};

let line_string = line_string![
    (x: 0., y: 0.),
    (x: 2., y: 0.),
    (x: 2., y: 2.),
    (x: 0., y: 2.),
    (x: 0., y: 0.),
];

let polygon = Polygon::new(line_string.clone(), vec![]);

// Point in Point
assert!(point!(x: 2., y: 0.).contains(&point!(x: 2., y: 0.)));

// Point in Linestring
assert!(line_string.contains(&point!(x: 2., y: 0.)));

// Point in Polygon
assert!(polygon.contains(&point!(x: 1., y: 1.)));
Loading content...

Implementors

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

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

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

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

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

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

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

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

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

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

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

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 Geometry<T> where
    T: Float
[src]

impl<T> Contains<Point<T>> for GeometryCollection<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 MultiLineString<T> where
    T: Float
[src]

impl<T> Contains<Point<T>> for MultiPoint<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...