-
Notifications
You must be signed in to change notification settings - Fork 215
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
Difference or intersection fail depending on BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE #1288
Comments
Thanks for the detailed examples and code. I can reproduce it. Note that |
This is definitely fine. We just tried that flag, because it seemed to fix our problems with the difference function. |
FirstCan you next time please provide a minimal scenario? 537 lines is too much to analyze SecondHerewith an example of such a scenario for the case you list in the description. I cannot reproduce it with Boost 1.85 nor with Boost 1.84
My output in all cases
Did you call "correct"? |
BTW the reason that I checked it again is that I have a concept fix for another recent issue and wanted to check if it would fix this as well. |
If you change your example in a way, that poly2 is a polygon, not a multipolygon (as in our test cases), the test fails for double and long double precision: [...] Output: Type: float a: 12 b: 1.04999999888 diff: 10.9500000179 ints: 1.04999999888 a-b: 10.9500000011 d+i 12.0000000168 validity diff: true ints: true So at least there is something wrong with this combination of input geometries. |
Nevertheless, I will check, if changing both input geometries to multipolygon, would solve all our issues. |
That should indeed not be necessary, poly should give the same result as multi poly |
Unfortunately I found a first example (from our "real life" issues), where also using mutlipolygon does not give the expected results: mp_t poly1; mp_t poly2; Output: |
and I can reproduce it so it's labeled as a bug now |
Can you please file other failing cases under new tickets? |
Sure, I can file a new ticket. |
We can really not work with such a bench, sorry. Because things are fixed one by one, there can (sometimes) be months in between and handled by different persons. So if one is fixed - the ticket should be closed. |
Ok, that's fine. I filed a new ticket #1299 |
The status is still the same, and weird, unfortunately.
|
Depending on if we set BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE, either difference or intersection fail for some of our test scenarios.
The test case for difference:
MULTIPOLYGON(((-2.0 -1.5, 2.0 -1.5, 2.0 1.5, -2.0 1.5)))
POLYGON((-0.5 -1.49999999, -2.0 -0.1, -1.99999999 -1.5))
difference(MULTIPOLYGON, POLYGON, result)
result should be like MULTIPOLYGON(((-2.0 -0.1, -0.5 -1.49999999, 2.0 -1.5, 2.0 1.5, -2.0 1.5)))
If we do not define BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE, result is empty.
If we define BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE, we get the expected result.
The test case for intersection:
MULTIPOLYGON(((1.0 2.0, 3.0 1.0, 4.0 3.0, 2.0 4.0)))
POLYGON((2.0 1.5, 3.0 1.5, 3.0 2.5, 2.0 2.5))
intersection(MULTIPOLYGON, POLYGON, result)
result should be like MULTIPOLYGON(((2.0 1.5, 3.0 1.5, 3.0 2.5, 2.0 2.5))), which is similar to the input POLYGON.
If we do not define BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE, we get the expected result.
If we define BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE, result contains the bigger input MULTIPOLYGON.
Attached BoostGeometryTests.cpp contains these 2 test cases and some more, which can be enabled by defining ALL_TEST_CASES 1 (in the second line).
BoostGeometryTests.cpp.txt
With Boost 1.71.0 all test cases succeed (in fact all but Intersection_04c1, where Intersection_04c2 is the same test with slightly adapted expectation - 5 points instead of 4).
With Boost 1.80.0 to 1.85.0 multiple tests fail (different, depending on the BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE flag).
It is not important, that we get exactly the declared expected results, but reasonable ones.
The text was updated successfully, but these errors were encountered: