**Subject:** [Boost-bugs] [Boost C++ Libraries] #9206: intersection of non-closed polygons returns closed polygon

**From:** Boost C++ Libraries (*noreply_at_[hidden]*)

**Date:** 2013-10-07 10:04:16

**Next message:**Boost C++ Libraries: "[Boost-bugs] [Boost C++ Libraries] #9207: different sizeof atomic_count (boost/asio/detail/atomic_count.hpp) type after comilation with --std=c++11 than after comilation without --std=c++11 (gcc, x86_64)."**Previous message:**Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #9192: condition_variable::notify_one hits debug assertion in MSVC2010"**Next in thread:**Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #9206: intersection of non-closed polygons returns closed polygon"**Reply:**Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #9206: intersection of non-closed polygons returns closed polygon"**Reply:**Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #9206: intersection of non-closed polygons returns closed polygon"**Reply:**Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #9206: intersection of non-closed polygons returns closed polygon"**Reply:**Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #9206: intersection of non-closed polygons returns closed polygon"**Reply:**Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #9206: intersection of non-closed polygons returns closed polygon"

#9206: intersection of non-closed polygons returns closed polygon

-------------------------------------------------+-------------------------

Reporter: Volker SchÃ¶ch <volker@â€¦> | Owner:

Type: Bugs | barendgehrels

Milestone: To Be Determined | Status: new

Version: Boost 1.52.0 | Component: geometry

Keywords: intersection, multi-polygon, | Severity: Problem

polygon, closed, open, correct |

-------------------------------------------------+-------------------------

The output multi-polygon from boost::geometry::intersection should have

the same orientation, closed-ness and underlying scalar data type, as the

input (multi-)polygons. My polygon type is '''oriented counter-

clockwise''' and '''not closed''', my point type is based on '''int'''.

Please find below some code that results in a closed polygon.

''Note: The sym_difference and difference algorithms have the same problem

which I filed as separate tickets #8375, #8376.''

This is the data used as input to intersection:

{{{

_TPolygon<int> const polygon =

_TPolygon<int>("MULTIPOLYGON(((1374 1092,1734 1092,3174 2526,3174

2886,1374 2886)))")

& _TPolygon<int>("POLYGON((2817 2449,2817 2603,3134 2603,3134

2449,2817 2449))");

}}}

This is the resulting multi-polygon, with the polygon being closed:

{{{

MULTIPOLYGON(((3134 2486,3134 2603,2817 2603,2817 2449,3096 2449,3134

2486)))

}}}

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::intersection(*this, geometry, polygonOut);

// should not be necessary

//boost::geometry::correct( polygonOut );

return polygonOut;

}

}}}

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

**Next message:**Boost C++ Libraries: "[Boost-bugs] [Boost C++ Libraries] #9207: different sizeof atomic_count (boost/asio/detail/atomic_count.hpp) type after comilation with --std=c++11 than after comilation without --std=c++11 (gcc, x86_64)."**Previous message:**Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #9192: condition_variable::notify_one hits debug assertion in MSVC2010"**Next in thread:**Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #9206: intersection of non-closed polygons returns closed polygon"**Reply:**Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #9206: intersection of non-closed polygons returns closed polygon"**Reply:**Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #9206: intersection of non-closed polygons returns closed polygon"**Reply:**Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #9206: intersection of non-closed polygons returns closed polygon"**Reply:**Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #9206: intersection of non-closed polygons returns closed polygon"**Reply:**Boost C++ Libraries: "Re: [Boost-bugs] [Boost C++ Libraries] #9206: intersection of non-closed polygons returns closed polygon"

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