diff --git a/doc/release_notes.qbk b/doc/release_notes.qbk index 22b1a9642..70c726f54 100644 --- a/doc/release_notes.qbk +++ b/doc/release_notes.qbk @@ -23,7 +23,8 @@ * The support of parameters convertible to value_type in rtree insert(), remove() and count() functions * Support for counterclockwise input/output in algorithm buffer -* Support for degenerate input in algorithm buffer +* Support for open-geometry input in algorithm buffer (open output not yet supported) +* Support for degenerate input (point-like linestrings, polygons) in algorithm buffer [*Solved tickets] diff --git a/include/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp b/include/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp index 2021a0481..c959ee849 100644 --- a/include/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp +++ b/include/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp @@ -16,6 +16,7 @@ #include +#include #include #include @@ -513,7 +514,12 @@ struct buffer_inserter bool has_output = false; std::size_t n = boost::size(simplified); - if (n > 3) + std::size_t const min_points = core_detail::closure::minimum_ring_size + < + geometry::closure::value + >::value; + + if (n >= min_points) { detail::normalized_view view(simplified); if (distance.negative()) diff --git a/test/algorithms/buffer/polygon_buffer.cpp b/test/algorithms/buffer/polygon_buffer.cpp index fe3e48bf5..f4cee670f 100644 --- a/test/algorithms/buffer/polygon_buffer.cpp +++ b/test/algorithms/buffer/polygon_buffer.cpp @@ -388,9 +388,12 @@ void test_mixed() bg::strategy::buffer::end_flat end_flat; std::ostringstream name; - name << "mixed_" << std::boolalpha << InputClockwise << "_" << OutputClockwise << "_" << InputClosed << "_" << OutputClosed; + name << "mixed_" << std::boolalpha + << InputClockwise << "_" << OutputClockwise + << "_" << InputClosed << "_" << OutputClosed; - test_one(name.str(), simplex, join_round, end_flat, 47.4831, 1.5); + test_one(name.str(), + simplex, join_round, end_flat, 47.4831, 1.5); } #ifdef HAVE_TTMATH @@ -402,13 +405,25 @@ int test_main(int, char* []) typedef bg::model::point dpoint; test_all(); + +#if ! defined(BOOST_GEOMETRY_TEST_ONLY_ONE_TYPE) test_all(); - //test_all >(); test_mixed(); test_mixed(); test_mixed(); test_mixed(); + test_mixed(); + test_mixed(); + test_mixed(); + test_mixed(); + +#ifdef HAVE_TTMATH + test_all >(); +#endif + +#endif + return 0; }