Boost C++ Libraries: Ticket #8364: "Overlay invalid input exception" (1) https://svn.boost.org/trac10/ticket/8364 <p> Please find below some code that triggers "Overlay invalid input exception" (in the last statement of the example). I have a couple of different reproductions, and since I'm not sure if they all share the same root cause, I'm filing them in separate tickets. </p> <p> As always, my polygon type is oriented <strong>counter-clockwise</strong> and <strong>not closed</strong>, my point type is based on <strong>int</strong>. </p> <p> This is the data that triggers the exception: </p> <pre class="wiki">_intPolygon polygon( "MULTIPOLYGON(((1031 1056,3232 1056,3232 2856,1031 2856)))" ); polygon -= _intPolygon( "MULTIPOLYGON(((1032 1458,1032 1212,2136 2328,3234 2220,3234 2412,2136 2646)))" ); polygon -= _intPolygon( "MULTIPOLYGON(((1032 1764,1032 1458,2136 2646,3234 2412,3234 2532,2136 2790)))" ); polygon -= _intPolygon( "MULTIPOLYGON(((1032 2130,1032 1764,2052 2712)),((3234 2580,2558 2690,3234 2532)),((2558 2690,2136 2790,2052 2712,2136 2760)))" ); polygon -= _intPolygon( "MULTIPOLYGON(((1032 2556,1032 2130,1778 2556)),((3234 2580,2136 2760,1778 2556,3234 2556)))" ); </pre><p> This is my code that wraps boost::geometry to implement the operators used above: </p> <pre class="wiki">template&lt;typename T&gt; template&lt;typename Geometry&gt; _TPolygon&lt; T &gt; _TPolygon&lt; T &gt;::operator-(Geometry const&amp; geometry) const { // should not be necessary //if( boost::geometry::area(geometry)==0 ) return *this; _TPolygon&lt; T &gt; polygonOut; boost::geometry::difference(*this, geometry, polygonOut); // should not be necessary //boost::geometry::correct( polygonOut ); return polygonOut; } template&lt;typename T&gt; template&lt;typename Geometry&gt; _TPolygon&lt;T&gt;&amp; _TPolygon&lt; T &gt;::operator-=(Geometry const&amp; geometry) { // boost::geometry::difference cannot operate in-place // http://lists.boost.org/geometry/2012/02/1796.php *this = *this - geometry; return *this; } template&lt;typename T&gt; template&lt;typename Geometry&gt; _TPolygon&lt; T &gt; _TPolygon&lt; T &gt;::operator^(Geometry const&amp; geometry) const { _TPolygon&lt; T &gt; polygonOut; boost::geometry::sym_difference(*this, geometry, polygonOut); // should not be necessary //boost::geometry::correct( polygonOut ); return polygonOut; } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8364 Trac 1.4.3 Volker Schöch <vschoech@…> Tue, 02 Apr 2013 15:53:26 GMT <link>https://svn.boost.org/trac10/ticket/8364#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8364#comment:1</guid> <description> <p> Note for think-cell: RT 7459 </p> </description> <category>Ticket</category> </item> <item> <author>Volker Schöch <vschoech@…></author> <pubDate>Wed, 03 Apr 2013 11:58:14 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/8364#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8364#comment:2</guid> <description> <p> Our conversation on the geometry mailing list regarding this issue in 1.48.0: <a class="ext-link" href="http://lists.boost.org/geometry/2012/02/1871.php"><span class="icon">​</span>http://lists.boost.org/geometry/2012/02/1871.php</a> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Barend Gehrels</dc:creator> <pubDate>Sat, 24 Aug 2013 20:04:02 GMT</pubDate> <title>keywords, status, milestone changed https://svn.boost.org/trac10/ticket/8364#comment:3 https://svn.boost.org/trac10/ticket/8364#comment:3 <ul> <li><strong>keywords</strong> spikes added </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.55.0</span> </li> </ul> Ticket Barend Gehrels Sat, 24 Aug 2013 22:53:45 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/8364#comment:4 https://svn.boost.org/trac10/ticket/8364#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/85451" title="[geometry] avoid generation of spikes in overlays, this fixes ticket ...">[85451]</a>) [geometry] avoid generation of spikes in overlays, this fixes ticket 8364 and 8365. Added unit tests for these tickets. These changes result in (at about 3 places) changes in the output-number-of-points, this is verified visually </p> Ticket Volker Schöch <vschoech@…> Thu, 14 Nov 2013 09:38:33 GMT <link>https://svn.boost.org/trac10/ticket/8364#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/8364#comment:5</guid> <description> <p> I can confirm that the problem is no longer reproducible with boost 1.55.0. </p> </description> <category>Ticket</category> </item> </channel> </rss>