Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
11.7.1
-
None
Description
As the doc described, the term spatially crosses denotes a spatial relation between two given geometries that has the following properties:
1.The two geometries intersect
2.Their intersection results in a geometry that has a dimension that is one less than the maximum dimension of the two given geometries
3.Their intersection is not equal to either of the two given geometries
It means, ST_Crosses(A, B) ⇔ ( dim(A ⋂ B) == max( dim(A), dim(B) ) - 1) ∧ (A ⋂ B ≠ A) ∧ (A ⋂ B ≠ B)
Considering following queries:
SET @g1 = ST_GeomFromText('MULTILINESTRING((28 99,2 10), (6 36, 62 85, 88 88))'); |
SET @g2 = ST_GeomFromText('GEOMETRYCOLLECTION(MULTILINESTRING((28 99,2 10)),LINESTRING(6 36,62 85,42 85,6 36))'); |
|
SELECT ST_CROSSES(@g1, @g2), ST_DIMENSION(ST_INTERSECTION(@g1,@g2)), ST_DIMENSION(@g1), ST_DIMENSION(@g2); |
-- result:{t, 1, 1, 1} |
dim(@g1 ∩ @g2)= dim(@g1) = dim(@g2) = max(dim(@g1), dim(@g2)) = 1, which does not meet Condition 2. But ST_CROSSES still gives a TRUE result.
When @ g2 is set as MULTILINESTRING, the result returns 0, which is as expected.
SET @g1 = ST_GeomFromText('MULTILINESTRING((28 99,2 10), (6 36, 62 85, 88 88))'); |
SET @g2 = ST_GeomFromText('MULTILINESTRING((28 99,2 10)),LINESTRING(6 36,62 85,42 85,6 36)'); |
|
SELECT ST_CROSSES(@g1, @g2), ST_DIMENSION(ST_INTERSECTION(@g1,@g2)), ST_DIMENSION(@g1), ST_DIMENSION(@g2); |
-- result:{f, 1, 1, 1} |