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

Side location conflict on intersects predicate #1051

Open
ebocher opened this issue Apr 26, 2024 · 5 comments
Open

Side location conflict on intersects predicate #1051

ebocher opened this issue Apr 26, 2024 · 5 comments

Comments

@ebocher
Copy link
Contributor

ebocher commented Apr 26, 2024

Dear Dr, the following test case returns a side location conflict

WKTReader reader =  new WKTReader();
Geometry gc0 = reader.read(
                "POLYGON ((414188.5999999999 6422867.1, 414193.7 6422866.5, 414205.1 6422859.4, 414223.7 6422846.8, 414229.6 6422843.2, 414235.2 6422835.4, 414224.7 6422837.9, 414219.4 6422842.1, 414210.9 6422849, 414199.2 6422857.6, 414191.1 6422863.4, 414188.5999999999 6422867.1))");
Geometry gc1 = reader.read(
                "LINESTRING (414187.2 6422831.6, 414179 6422836.1, 414182.2 6422841.8, 414176.7 6422844, 414184.5 6422859.5, 414188.6 6422867.1)");
assertTrue(gc0.intersects(gc1));

Reported on orbisgis/geoclimate#947

Best regards

@dr-jts
Copy link
Contributor

dr-jts commented Apr 26, 2024

Thanks for this. The good news is that the upcoming RelateNG algorithm handles this correctly. I'll add it to the list of robustness issues to fix.

@ebocher
Copy link
Contributor Author

ebocher commented Jun 24, 2024

Here another example that returns a side conflict location.
Tested with the current 1.20-SNAPSHOT

Geometry gc0 = reader.read(
                "POLYGON ((474007.37387468846 5286568.023144805, 474027.7175788997 5286573.266943434, 474028.8194209462 5286568.149451445, 474027.0178892645 5286567.712940417, 474027.8267687816 5286564.1527563, 474029.55282332335 5286564.478462566, 474030.58366500423 5286560.250429942, 474021.5764896469 5286558.179018065, 474020.5456541259 5286562.4070523, 474021.74684248475 5286562.7351050675, 474020.4930542351 5286567.408707694, 474016.51508399716 5286566.537369314, 474016.1461484541 5286567.872732597, 474014.1946537856 5286567.436896746, 474014.1166879452 5286566.770389721, 474009.1619732661 5286565.458857827, 474007.37387468846 5286568.023144805))");
Geometry gc1 = reader.read(
                "POLYGON ((473936.1801007541 5286478.294544354, 473993.2799454166 5286568.641978126, 474007.3738746885 5286568.023144805, 473936.1801007541 5286478.294544354))");
assertTrue(gc0.intersects(gc1));

@dr-jts
Copy link
Contributor

dr-jts commented Jun 29, 2024

Here another example that returns a side conflict location. Tested with the current 1.20-SNAPSHOT

Works with RelateNG (up to a point - there is still a robustness issue, but it's not a failure. Thinking about what to do about this).

Note that RelateNG is not wired in to replace the old Relate code yet - that will happen in the next release.

@dr-jts dr-jts changed the title Side location conflict on intersect predicate Side location conflict on intersects predicate Aug 14, 2024
@ebocher
Copy link
Contributor Author

ebocher commented Sep 2, 2024

JTS 1.20 is out. Thanks a lot !

Do we need to replace

assertTrue(gc0.intersects(gc1)); 

by

 assertTrue(RelateNG.relate(gc0, gc1, RelatePredicate.intersects()))

@dr-jts
Copy link
Contributor

dr-jts commented Sep 2, 2024

You can do that. Or you can set the -Djts.relate=ng system property, which will use RelateNG for the Geometry topological predicates.

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