Subject: [geometry] Problems with intersects in boost v1.57.0
From: Steve Youngs (Steve.Youngs_at_[hidden])
Date: 2014-11-20 11:36:30
I'm currently trying to update our application from Boost 1.55.0 to 1.57.0 but I'm running into problems with bg::intersects (for a single geometry) returning true in 1.57 when in 1.55 it is false.
More specifically, we have a linestring<bg::model::d2::point_xy<double>> for which boost 1.55 says there are no self-intersections whilst 1.57 says there is 1 self-intersection.
The linestring is closed and, internally, the turn reported by detail::self_get_turn_points::get_turns is of type bg::method_touch and the turn point given is equal to the first and last point of the linestring (remember the linestring is closed). Thinking that it was perhaps ambiguous to call intersects with a closed linestring, I also tried the same co-ordinates in a ring but observed the same behaviour; intersects returns true due to a method_touch turn at the first/last point. I am seeing this error in only a very small number of our tests which currently makes me think it is a numerical stability type issue rather than a general problem.
Looking at the change history of intersects.hpp, the robustness policy was changed to no_rescale_policy in commit e1dfe2e. This seems to have caused my problem. If I revert this change then intersects, in 1.57.0, is reporting false again. Does anyone have information on why this change to no_rescale_policy was made?
I have a small test case which I can log as a ticket if that is the best approach. The example is too big to post inline here.
I am using Visual Studio 2013.
Geometry list run by mateusz at loskot.net