Boost C++ Libraries: Ticket #9988: boost::geometry::intersection returns opposite of intersection https://svn.boost.org/trac10/ticket/9988 <p> For some geometries boost intersection returns a geometry that is the opposite (the geometric difference) of the intersection. Here is an exampl. Geometry 1: POLYGON((-84.5922 35.9063, -84.5924 35.9064, -84.5929 35.9062, -84.5926 35.9057, -84.5927 35.9056, -84.5926 35.9054, -84.5915 35.9058, -84.5915 35.906, -84.5918 35.9065, -84.5922 35.9063)) Geometry 2: POLYGON((-84.5932 35.9051, -84.5932 35.906, -84.5921 35.906, -84.5921 35.9051, -84.5932 35.9051)) Output: POLYGON((-84.5928 35.906, -84.5926 35.9057,-84.5927 35.9056, -84.5926 35.9054, -84.5921 35.9056, -84.5921 35.9051, -84.5932 35.9051, -84.5932 35.906, -84.5928 35.906)) Correct Output: POLYGON ((-84.5921 35.905581818181815, -84.5926 35.9054, -84.5927 35.9056, -84.5926 35.9057, -84.59278 35.906, -84.5921 35.906, -84.5921 35.905581818181815)) </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9988 Trac 1.4.3 anonymous Fri, 02 May 2014 13:45:49 GMT <link>https://svn.boost.org/trac10/ticket/9988#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9988#comment:1</guid> <description> <p> Sorry for the formatting, I don't think I can edit the post. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Barend Gehrels</dc:creator> <pubDate>Tue, 06 May 2014 12:43:04 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/9988#comment:2 https://svn.boost.org/trac10/ticket/9988#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> Hi, thanks for your report. </p> <p> One of your geometries is counter clockwise. Please use boost::geometry::correct in that case. If done, the intersection is OK. Producing the difference with a counter clockwise polygon is intentional - it considers all of the outside as the polygon, and makes an intersection with that all-of-the-outside with the polygon. This is the difference. </p> <p> I resolve it as "invalid" </p> <p> Regards, Barend </p> Ticket