[Boost-bugs] [Boost C++ Libraries] #9828: boost::geometry::union_(...) creates redundant closing point

Subject: [Boost-bugs] [Boost C++ Libraries] #9828: boost::geometry::union_(...) creates redundant closing point
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-04-02 11:44:08


#9828: boost::geometry::union_(...) creates redundant closing point
-------------------------------------------------+-------------------------
 Reporter: Volker Schöch <vschoech@…> | Owner:
     Type: Bugs | barendgehrels
Milestone: To Be Determined | Status: new
  Version: Boost 1.55.0 | Component: geometry
 Keywords: union, multi-polygon, polygon, | Severity: Problem
  correct |
-------------------------------------------------+-------------------------
 Polygons created by boost::geometry algorithms should conform to the same
 rules as the input. In the following example, boost::geometry::union_
 takes two simple, non-empty rectangular polygons and creates a polygon
 with a redundant closing point. My polygon type is oriented '''counter-
 clockwise''' and '''not closed''', my point type is based on '''int'''.

 This is the data used as input to union:
 {{{
 _TPolygon<int> const polygon =
         _TPolygon<int>("MULTIPOLYGON(((3398 1759,3592 1759,3592 1893,3398
 1893)))")
         | _TPolygon<int>( "MULTIPOLYGON(((3592 1893,3592 1759,3910
 1759,3910 1893)))" );
 }}}

 This is the resulting multi-polygon with the redundant closing point:
 {{{
 MULTIPOLYGON(((3592 1893,3398 1893,3398 1759,3592 1759,3910 1759,3910
 1893,3592 1893)))
 }}}

 This is my code that wraps boost::geometry to implement the operator used
 above:
 {{{
 template<typename T>
 template<typename Geometry>
 _TPolygon< T > _TPolygon< T >::operator|(Geometry const& geometry) const
 {
         _TPolygon< T > polygonOut;
         boost::geometry::union_(*this, geometry, polygonOut);

         // the following line fixes the problem but should not be
 necessary
         //boost::geometry::correct( polygonOut );

         return polygonOut;
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9828>
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:15 UTC