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

ST_Relate gives incorrect result for interior-interior intersection dimension #1053

Open
cuteDen-ECNU opened this issue Mar 5, 2024 · 2 comments
Labels

Comments

@cuteDen-ECNU
Copy link

cuteDen-ECNU commented Mar 5, 2024

Considering the following statement:

SELECT ST_Relate(g1, g2)
  FROM (VALUES
  ('MULTILINESTRING((2 4, 10 10),(15 10,10 5,5 10))'::geometry, 
   'MULTILINESTRING((2 4, 10 10))'::geometry)
  ) AS sdb(g1, g2);

--expected{ 1F1F001F2}; actual{ 0F1F001F2}
bin/geosop -a 'MULTILINESTRING((2 4, 10 10),(15 10,10 5,5 10))' -b 'MULTILINESTRING((2 4, 10 10))' relate
# expected{ 1F1F001F2}; actual{ 0F1F001F2}

The intersection of interior-interior of g1 and g2 is LINESTRING(2 4, 10 10) whose dimension is 1. Thus the de9im code should be 1F1F001F2 instead of 0F1F001F2.

The version of Geos is the latest one:
bdceea6

@dr-jts
Copy link
Contributor

dr-jts commented Mar 5, 2024

This is an example of a long-standing design issue with the current topological predicate algorithm. See also:

While #937 was a fix for some cases of this type, it was not a fully general fix.

There is a new topological predicate algorithm being worked on which solves this problem. It should be ready by mid-2024.

@dr-jts
Copy link
Contributor

dr-jts commented May 5, 2024

Actually the expected result is 1F1F00FF2 (since A contains B, the Exterior of A does not interact with the Interior of B).

This result is correctly computed by the RelateNG algorithm.

@dr-jts dr-jts changed the title ST_Relate gives error result in interior-interior intersection dimension ST_Relate gives incorrect result in interior-interior intersection dimension May 7, 2024
@dr-jts dr-jts changed the title ST_Relate gives incorrect result in interior-interior intersection dimension ST_Relate gives incorrect result for interior-interior intersection dimension May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants