Skip to content
Updated Intersection Matrix Calculation (markdown) authored by eswiss's avatar eswiss
...@@ -132,14 +132,26 @@ The IM for a MultilineString (not LinearRing?) and a LineString, in that order, ...@@ -132,14 +132,26 @@ The IM for a MultilineString (not LinearRing?) and a LineString, in that order,
I ∩ I = 0, if line segments from each geometry intersect at the interior of both, else .false 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 ∩ 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.) 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 ∩ I = 0, if at least one of the endpoints of the MultilineString intersects the interior of 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 ∩ 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 B ∩ E = 0, if at least one of the endpoints of the MultilineString does 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 ∩ 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 ∩ B = 0, if the two endpoints of the LineString do not lie on the MultilineString, else .false
E ∩ E = 2 E ∩ E = 2
If the order of the two geometries is reversed, the intersection matrix would be the transpose of the above. 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 LinearRing, in that order, is
I ∩ I = 0, if line segments from each geometry intersect at the interior of both, else .false
I ∩ B = .false
I ∩ E = 1, if part of one line segment of the MultilineString 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 MultilineString intersects the LinearRing, else .false
B ∩ B = .false
B ∩ E = 0, if at least one of the endpoints of the MultilineString does not lie on the LinearRing, else .false
E ∩ I = 1, if part of the LinearRing lies outside of the MultilineString, else .false (Note this value cannot be 0.)
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 dimension of the intersection of two geometries, one of which is dimension .one and the other dimension .two, is either .zero, .one, or .false** **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. 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.
... ...
......