diff --git a/include/boost/geometry/algorithms/detail/is_simple/debug_linear.hpp b/include/boost/geometry/algorithms/detail/is_simple/debug_linear.hpp index dfae0aef6..1e4f174a2 100644 --- a/include/boost/geometry/algorithms/detail/is_simple/debug_linear.hpp +++ b/include/boost/geometry/algorithms/detail/is_simple/debug_linear.hpp @@ -15,15 +15,17 @@ #include #include -#include #include #include +#include + #include #include +#include #include #endif @@ -58,30 +60,31 @@ inline void debug_print_turns(TurnIterator first, TurnIterator beyond) template -inline void debug_print_endpoints(MultiLinestring const& multilinestring) +inline void debug_print_boundary_points(MultiLinestring const& multilinestring) { #ifdef GEOMETRY_TEST_DEBUG typedef typename point_type::type point_type; typedef std::vector point_vector; - point_vector endpoints; + point_vector boundary_points; for (typename boost::range_iterator::type it = boost::begin(multilinestring); it != boost::end(multilinestring); ++it) { - BOOST_ASSERT ( boost::size(*it) != 1 ); - if ( boost::size(*it) != 0 ) + if ( boost::size(*it) > 1 + && !geometry::equals(range::front(*it), range::back(*it)) ) { - endpoints.push_back( *boost::begin(*it) ); - endpoints.push_back( *(--boost::end(*it)) ); + boundary_points.push_back( range::front(*it) ); + boundary_points.push_back( range::back(*it) ); } } - std::sort(endpoints.begin(), endpoints.end(), geometry::less()); + std::sort(boundary_points.begin(), boundary_points.end(), + geometry::less()); - std::cout << "endpoints: "; - for (typename point_vector::const_iterator pit = endpoints.begin(); - pit != endpoints.end(); ++pit) + std::cout << "boundary points: "; + for (typename point_vector::const_iterator pit = boundary_points.begin(); + pit != boundary_points.end(); ++pit) { std::cout << " " << geometry::dsv(*pit); }