geo/algorithm/contains/
geometry_collection.rs

1use super::{impl_contains_from_relate, impl_contains_geometry_for, Contains};
2use crate::geometry::*;
3use crate::{GeoFloat, GeoNum};
4
5impl<T> Contains<Coord<T>> for GeometryCollection<T>
6where
7    T: GeoNum,
8{
9    fn contains(&self, coord: &Coord<T>) -> bool {
10        self.iter().any(|geometry| geometry.contains(coord))
11    }
12}
13
14impl<T> Contains<Point<T>> for GeometryCollection<T>
15where
16    T: GeoNum,
17{
18    fn contains(&self, point: &Point<T>) -> bool {
19        self.contains(&point.0)
20    }
21}
22
23impl_contains_from_relate!(GeometryCollection<T>, [Line<T>, LineString<T>, Polygon<T>, MultiPoint<T>, MultiLineString<T>, MultiPolygon<T>, GeometryCollection<T>, Rect<T>, Triangle<T>]);
24impl_contains_geometry_for!(GeometryCollection<T>);