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.
The IM for the two disjoint geometries of dimensions .two and .one, in that order, is (1) FF2FF1102, if the second geometry is a LineString or MultilineString, or (2) FF2FF11F2, if the second geometry is a LinearRing. If the order of the two geometries is reversed, the intersection matrix would be the transpose of the above.
The IM for a Polygon and a LineString (not LinearRing), in that order, that do intersect is
I ∩ I = 1, if at least one line segment of the LineString enters the interior of the Polygon, else .false (Note this value cannot be 0.)
I ∩ B = 0, if the interior of one line segment of the LineString is inside the polygon, else .false
I ∩ E = 2
B ∩ I = 1, if one line segment of the boundary of the Polygon overlaps one line segment from the LineString, else 0, if the interior of the LineString segments touch the Polygon at most a set of points, else .false
B ∩ B = 0, if the endpoints of the LineString touch the line segments of the boundary at one or more points, else .false
B ∩ E = 1
E ∩ I = 1, if part of one line segment of the LineString lies outside of the Polygon, else .false (Note this value cannot be 0.)
E ∩ B = 0, if at least one endpoint of the LineString lies outside of the Polygon, else .false
E ∩ E = 2
**The dimension of the intersection of two geometries, both of which are dimension .two, is either .zero,.one, .two., or .false**
**The dimension of the intersection of two geometries, both of which are dimension .two, is either .zero,.one, .two., or .false**