Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential Bug in ST_Crosses. #196

Closed
cuteDen-ECNU opened this issue Nov 24, 2023 · 2 comments
Closed

Potential Bug in ST_Crosses. #196

cuteDen-ECNU opened this issue Nov 24, 2023 · 2 comments

Comments

@cuteDen-ECNU
Copy link

Consider the following statement:

SELECT ST_Crosses(g1, g2), ST_Crosses(g1, g3)
FROM (SELECT 
ST_GeomFromText('GEOMETRYCOLLECTION (POINT (7 1), LINESTRING (6 5, 6 4))') As g1,
ST_GeomFromText('POLYGON ((7 1, 1 3,  3 9,  7 1))') As g2,
ST_GeomFromText('POLYGON ((1 3,  3 9,  7 1,  1 3))') As g3
) As sub;
-- actual {true, false}; expected {false, false}

It is noticed that g2 and g3 present the same polygon with different order, while ST_Crosses(g1, g2) and ST_Crosses(g1, g3) give different results, which seems a bug.

The result of ST_Crosses(g1, g2) is expected to be false because there is no interior intersection, according to the definition:

ST_Crosses(A, B) ⇔ (dim( Int(A) ⋂ Int(B) ) < max( dim( Int(A) ), dim( Int(B) ) )) ∧ (A ⋂ B ≠ A) ∧ (A ⋂ B ≠ B)

Here is the visual:

a

Version:

The result of "pragma version;" is [('v0.9.2', '3c695d7ba9')]

I used "FORCE INSTALL spatial FROM 'http://nightly-extensions.duckdb.org/';" in the Python client.

@cuteDen-ECNU
Copy link
Author

cuteDen-ECNU commented Jan 10, 2024

Hi, Max! It was confirmed as a libgeos bug.

@Maxxen
Copy link
Member

Maxxen commented Jan 10, 2024

Alright, thanks! I suspected that, will make sure to update GEOS again soon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants