[Boost-bugs] [Boost C++ Libraries] #12752: difference algorithm returning invalid geometry (regression over 1.59.0)

Subject: [Boost-bugs] [Boost C++ Libraries] #12752: difference algorithm returning invalid geometry (regression over 1.59.0)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-01-12 12:23:39


#12752: difference algorithm returning invalid geometry (regression over 1.59.0)
----------------------------------------+---------------------------
 Reporter: Volker Schöch <vschoech@…> | Owner: barendgehrels
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: geometry
  Version: Boost 1.63.0 | Severity: Problem
 Keywords: |
----------------------------------------+---------------------------
 My "tc::geo::polygon" type is actually a '''multi-polygon''', using a
 polygon type that is based on '''int''', oriented '''counter-clockwise'''
 and '''open''' (not closed). Please consider the following example:
 {{{
 tc::geo::polygon<int> polygonA;
 boost::geometry::read_wkt("MULTIPOLYGON(((3232 2413,2136 2646,3232
 2412,3232 2413)),((3232 2532,3232 2856,1031 2856,1031 1056,3232 1056,3232
 2221,2136 2328,1032 1212,1032 1458,1032 1764,2136 2790,3232 2532)))",
 polygonA); // does not throw
 _ASSERT( boost::geometry::is_valid(polygonA) ); // returns true

 tc::geo::polygon<int> polygonB;
 boost::geometry::read_wkt("MULTIPOLYGON(((1032 2130,1032 1764,2052
 2712,1032 2130)),((3234 2580,2558 2690,3234 2532,3234 2580)),((2558
 2690,2136 2790,2052 2712,2136 2760,2558 2690)))", polygonB); // does not
 throw
 _ASSERT( boost::geometry::is_valid(polygonB) ); // returns true

 tc::geo::polygon<int> polygonC;
 boost::geometry::difference(polygonA, polygonB, polygonC); // does not
 throw
 // polygonC: MULTIPOLYGON(((3232 2413,2136 2646,3232 2412,3232
 2413)),((2568 2688,3232 2580,3232 2856,1031 2856,1031 1056,3232 1056,3232
 2221,2136 2328,1032 1212,1032 1458,1032 1764,2052 2712,2136 2790,2568
 2688),(1032 1764,1032 2130,2052 2712,1032 1764)),((2952 2598,3232
 2532,3232 2533,2952 2598)))
 boost::geometry::is_valid(polygonC); // returns false!
 }}}
 The difference of two valid multi-polygons yields an invalid multi-
 polygon.

 May be related to tickets #10661, #11674, #11676, #12751.

 This problem was NOT present in boost 1.59.0.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/12752>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC