|
1 | 1 | use super::Contains;
|
2 | 2 | use crate::intersects::Intersects;
|
3 |
| -use crate::kernels::HasKernel; |
4 |
| -use crate::{CoordNum, Coordinate, Line, LineString, MultiPolygon, Point, Polygon}; |
| 3 | +use crate::{CoordNum, Coordinate, GeoNum, Line, LineString, MultiPolygon, Point, Polygon}; |
5 | 4 |
|
6 | 5 | // ┌─────────────────────────────┐
|
7 | 6 | // │ Implementations for Polygon │
|
8 | 7 | // └─────────────────────────────┘
|
9 | 8 |
|
10 | 9 | impl<T> Contains<Coordinate<T>> for Polygon<T>
|
11 | 10 | where
|
12 |
| - T: HasKernel, |
| 11 | + T: GeoNum, |
13 | 12 | {
|
14 | 13 | fn contains(&self, coord: &Coordinate<T>) -> bool {
|
15 | 14 | use crate::algorithm::coordinate_position::{CoordPos, CoordinatePosition};
|
|
20 | 19 |
|
21 | 20 | impl<T> Contains<Point<T>> for Polygon<T>
|
22 | 21 | where
|
23 |
| - T: HasKernel, |
| 22 | + T: GeoNum, |
24 | 23 | {
|
25 | 24 | fn contains(&self, p: &Point<T>) -> bool {
|
26 | 25 | self.contains(&p.0)
|
|
31 | 30 | // line.start and line.end is on the boundaries
|
32 | 31 | impl<T> Contains<Line<T>> for Polygon<T>
|
33 | 32 | where
|
34 |
| - T: HasKernel, |
| 33 | + T: GeoNum, |
35 | 34 | {
|
36 | 35 | fn contains(&self, line: &Line<T>) -> bool {
|
37 | 36 | // both endpoints are contained in the polygon and the line
|
|
46 | 45 | // TODO: also check interiors
|
47 | 46 | impl<T> Contains<Polygon<T>> for Polygon<T>
|
48 | 47 | where
|
49 |
| - T: HasKernel, |
| 48 | + T: GeoNum, |
50 | 49 | {
|
51 | 50 | fn contains(&self, poly: &Polygon<T>) -> bool {
|
52 | 51 | // decompose poly's exterior ring into Lines, and check each for containment
|
|
57 | 56 | // TODO: ensure DE-9IM compliance
|
58 | 57 | impl<T> Contains<LineString<T>> for Polygon<T>
|
59 | 58 | where
|
60 |
| - T: HasKernel, |
| 59 | + T: GeoNum, |
61 | 60 | {
|
62 | 61 | fn contains(&self, linestring: &LineString<T>) -> bool {
|
63 | 62 | // All LineString points must be inside the Polygon
|
|
0 commit comments