Boost C++ Libraries: Ticket #12355: False self intersection https://svn.boost.org/trac10/ticket/12355 <p> Please see the following code: </p> <pre class="wiki">#include &lt;boost/geometry.hpp&gt; #include &lt;boost/geometry/geometries/point_xy.hpp&gt; #include &lt;boost/geometry/geometries/polygon.hpp&gt; using namespace boost::geometry; typedef double FloatType; typedef model::d2::point_xy&lt;FloatType&gt; Point; typedef model::polygon&lt;Point&gt; Polygon; typedef model::multi_polygon&lt;Polygon&gt; MultiPolygon; typedef model::ring&lt;Point&gt; Ring; typedef model::box&lt;Point&gt; Box; typedef model::linestring&lt;Point&gt; LineString; int main(int argc, char *argv[]) { using namespace std; Polygon p1; boost::geometry::read_wkt("POLYGON((440408.69120520249 5684415.5176829416," "440376.96050000004 5684329.5744000003," "440376.93154344801 5684329.5945822615," "440408.69005920028 5684415.5145825278," "440408.69120520249 5684415.5176829416))", p1); std::string err; bool valid = boost::geometry::is_valid(p1, err); cout &lt;&lt; "is_valid(p1): " &lt;&lt; (valid?"true":"false") &lt;&lt; ":\n" &lt;&lt; err &lt;&lt; endl; Polygon p2; boost::geometry::read_wkt("POLYGON((" "440408.83723096416 5684415.9121634094," "440421.56219999958 5684410.6604999993," "440423.30049999990 5684412.0036999993," "440439.33189999964 5684394.8839999996," "440423.75960000046 5684357.4199000001," "440420.99959999975 5684350.7814000007," "440404.12129999977 5684310.1740000006," "440393.24469999969 5684317.6517999992," "440377.49349999987 5684329.2028999999," "440376.96050000004 5684329.5744000003," "440408.69005920028 5684415.5145825278," "440408.69120520249 5684415.5176829416," "440408.83689894457 5684415.9118452258," "440408.83723096416 5684415.9121634094))", p2); MultiPolygon mp; union_(p1, p2, mp); cout &lt;&lt; "mp: " &lt;&lt; boost::geometry::wkt(mp) &lt;&lt; endl; return 0; } </pre><p> Output: </p> <pre class="wiki">is_valid(p1): false: Geometry has invalid self-intersections. A self-intersection point was found at (440409, 5.68442e+006); method: i; operations: i/u; segment IDs {source, multi, ring, segment}: {0, -1, -1, 0}/{0, -1, -1, 2} mp: MULTIPOLYGON(((440409 5.68442e+006,440409 5.68442e+006,440377 5.68433e+006,440409 5.68442e+006))) </pre><p> Both polygons (p1 and p2) are in fact valid, without any self-intersections. But boost.geometry sees one and can't union the two polygons correctly. </p> <p> Thank you, for the good work. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12355 Trac 1.4.3