I get a Run-time error when using boost::geometry::intersects to judge if two geometries intersect each other, I get this errors:
test:/bigdisk/geo.algorithms/mason_packages/headers/boost/1.65.1/include/boost/geometry/policies/robustness/segment_ratio.hpp:54: static bool boost::geometry::detail::segment_ratio::less::apply(const Ratio&, const Ratio&) [with Ratio = boost::geometry::segment_ratio; Type = double]: Assertion `lhs.denominator() != 0' failed. line1 equals line2: Aborted
It's not obvious what the problem is to my naive eyes. If anyone has any suggestions I would be very grateful.
I have adapted boost geometry to my own geometry model and boost's intersects function just aborted in this case:
point<double, GCJ02LL> pt11{118.8031, 32.10011};
point<double, GCJ02LL> pt12{118.80297, 32.10016};
point<double, GCJ02LL> pt13{118.80284, 32.10021};
dataop::geometry::line_string<double, GCJ02LL> line1{pt11, pt12, pt13};
dataop::geometry::line_string<double, GCJ02LL> line2{pt11, pt12, pt13};
std::cout << "line1 intersects line2? : " << intersects(line1, line2) << std::endl;
you can see my two line_strings is same, but it is not the problem because in other cases it runs well.
Even more strange is that the boost::geometry::equal will also aborted in this case like this:
point<double, GCJ02LL> pt11{118.8031, 32.10011};
point<double, GCJ02LL> pt12{118.80297, 32.10016};
point<double, GCJ02LL> pt13{118.80284, 32.10021};
dataop::geometry::line_string<double, GCJ02LL> line1{pt11, pt12, pt13};
std::cout << "line1 equal line1? " << equal(line1, line1) << std::endl;