-
Notifications
You must be signed in to change notification settings - Fork 200
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cda3fed
commit ffecf0c
Showing
12 changed files
with
362 additions
and
247 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use super::{impl_contains_from_relate, impl_contains_geometry_for, Contains}; | ||
use crate::geometry::*; | ||
use crate::{GeoFloat, GeoNum}; | ||
|
||
impl<T> Contains<Coordinate<T>> for GeometryCollection<T> | ||
where | ||
T: GeoNum, | ||
{ | ||
fn contains(&self, coord: &Coordinate<T>) -> bool { | ||
self.iter().any(|geometry| geometry.contains(coord)) | ||
} | ||
} | ||
|
||
impl<T> Contains<Point<T>> for GeometryCollection<T> | ||
where | ||
T: GeoNum, | ||
{ | ||
fn contains(&self, point: &Point<T>) -> bool { | ||
self.contains(&point.0) | ||
} | ||
} | ||
|
||
impl_contains_from_relate!(GeometryCollection<T>, [Line<T>, LineString<T>, Polygon<T>, MultiPoint<T>, MultiLineString<T>, MultiPolygon<T>, GeometryCollection<T>, Rect<T>, Triangle<T>]); | ||
impl_contains_geometry_for!(GeometryCollection<T>); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.