Boost C++ Libraries: Ticket #13593: intersects assertion failure for linestrings in spherical_equatorial coordinates https://svn.boost.org/trac10/ticket/13593 <p> I have found a specific case when boost::geometry::intersects fails with assertion "lhs.denominator() != 0" on linestrings with equal (or very close) segments in spherical_equatorial coordinate system. Here is the test example: </p> <pre class="wiki">#include &lt;iostream&gt; #include &lt;boost/geometry.hpp&gt; #include &lt;boost/geometry/geometries/linestring.hpp&gt; #include &lt;boost/geometry/geometries/point_xy.hpp&gt; #include &lt;boost/version.hpp&gt; int main() { using GeoCoordSystem = boost::geometry::cs::spherical_equatorial&lt;boost::geometry::degree&gt;; using GeoPoint = boost::geometry::model::d2::point_xy&lt;double, GeoCoordSystem&gt;; boost::geometry::model::linestring&lt;GeoPoint&gt; line1, line2; boost::geometry::read_wkt("linestring(11.5800734 48.2523631, 11.580114 48.2524051, 11.5801572 48.2524435)", line1); boost::geometry::read_wkt("linestring(11.5800734 48.2523631, 11.580114 48.2524051, 11.5801572 48.2524434)", line2); std::cout &lt;&lt; "Using boost v" &lt;&lt; BOOST_VERSION &lt;&lt; std::endl; const bool b = boost::geometry::intersects(line1, line2); std::cout &lt;&lt; "Intersects: " &lt;&lt; (b ? "YES" : "NO") &lt;&lt; std::endl; return 0; } </pre><p> Program output is the following: </p> <pre class="wiki">Using boost v106700 a.out: /opt/Storage/Install/boost_1_67_0/boost/geometry/policies/robustness/segment_ratio.hpp:54: static bool boost::geometry::detail::segment_ratio::less&lt;Type, false&gt;::apply(const Ratio&amp;, const Ratio&amp;) [with Ratio = boost::geometry::segment_ratio&lt;double&gt;; Type = double]: Assertion `lhs.denominator() != 0' failed. Aborted (core dumped) </pre><p> The issue is reproducible in both boost v1.63 and latest v1.67. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13593 Trac 1.4.3