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
intersects() returns true when it shouldn't #175
Comments
Thanks for the detailed report. I've been able to reproduce the issue. |
Managed to fix the issue, there was multiple problems in the port for the optimized case with rectangles. Unfortunately there still seem to be an issue with more complex cases - the case "AA - A-hole contains B, boundaries touch in line" in TestRelateAA fail with the new code. I guess that case wasn't hitting the optimized code earlier. |
Thank you!! |
Found the other case, all tests passing. :) Closing.. |
Hi,
In the following code, jsts says the following 2 geometries (see image below) intersect when they actually don't.
The intersection method correctly returns GEOMETRYCOLLECTION EMPTY.
Issue seems to occur when one of the geometries is a rectangle and the envelopes of the 2 geometries intersect.
var jsts = require('jsts');
var wktReader = new jsts.io.WKTReader();
var geo1 = wktReader.read('POLYGON ((0 7,3 7,3 10,0 10,0 7))');
var geo2 = wktReader.read('POLYGON ((0 0,10 0,10 10,0 0))');
console.log('geo1.intersects(geo2):', geo1.intersects(geo2));
console.log('geo1.intersection(geo2):', geo1.intersection(geo2).toString());
//// output
//geo1.intersects(geo2): true
//geo1.intersection(geo2): GEOMETRYCOLLECTION EMPTY
Thank you,
Arnold
The text was updated successfully, but these errors were encountered: