Skip to content
Updated Intersection Matrix Calculation (markdown) authored by eswiss's avatar eswiss
......@@ -121,13 +121,25 @@ I ∩ I = 0, if line segments from each geometry intersect at the interior of bo
I ∩ B = 0, .false
I ∩ E = 1, if part of one line segment of the LineString lies outside of the LinearRing, else .false (Note this value cannot be 0.)
B ∩ I = 0, if at least one of the endpoints of the LineString intersects the LinearRing, else .false
B ∩ B = 0, .false
B ∩ B = .false
B ∩ E = 0, if the two endpoints of the LineString do not both lie on the LinearRing, else .false
E ∩ I = 1 (Note part of the LinearRing must lie outside of the LineString)
E ∩ B = .false
E ∩ E = 2
If the order of the two geometries is reversed, the intersection matrix would be the transpose of the above.
The IM for a MultilineString (not LinearRing?) and a LineString, in that order, is
I ∩ I = 0, if line segments from each geometry intersect at the interior of both, else .false
I ∩ B = 0, if the interior of one line segment of the MultilineString intersects an endpoint of the LineString, else .false
I ∩ E = 1, if part of one line segment of the MultilineString lies outside of the LineString, else .false (Note this value cannot be 0.)
B ∩ I = 0, if at least one of the endpoints of the MultilineString intersects the LineString, else .false
B ∩ B = 0, if at least one of the endpoints of the MultilineString intersects one of the endpoints of the LineString, else .false
B ∩ E = 0, if all the endpoints of the MultilineString do not lie on the LineString, else .false
E ∩ I = 1, if part of the LineString lies outside of the MultilineString, else .false (Note this value cannot be 0.)
E ∩ B = 0, if the two endpoints of the LineString do not lie on the MultilineString, else .false
E ∩ E = 2
If the order of the two geometries is reversed, the intersection matrix would be the transpose of the above.
**The dimension of the intersection of two geometries, one of which is dimension .one and the other dimension .two, is either .zero, .one, or .false**
Use the SweepLineIntersector algorithm. If two segments, one from each geometry, overlap on any sub-segment, return .one. If a segment from the one-dimensional geometry crosses into the interior of the polygon, return .one. If the one-dimensional geometry is completely contained in the polygon, but not completely contained in one of its holes, return .one. If the one-dimensional geometry is completely contained in a hole of the polygon, return .zero. If the two geometries intersect at one more points, return .zero, else return .false.
......
......