Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buffer returns an invalid result #1233

Open
vissarion opened this issue Jan 26, 2024 · 1 comment
Open

buffer returns an invalid result #1233

vissarion opened this issue Jan 26, 2024 · 1 comment

Comments

@vissarion
Copy link
Member

The following returns an invalid result in 1.84 (while returning MULTIPOLYGON() in 1.78).

#include <boost/geometry.hpp>

int main() {


    using Point = boost::geometry::model::d2::point_xy<double>;
    using Polygon = boost::geometry::model::polygon<Point>;
    using Linestring = boost::geometry::model::linestring<Point>;
    using MultiPolygon = boost::geometry::model::multi_polygon<Polygon>;
    using MultiLinestring = boost::geometry::model::multi_linestring<Linestring>;

    boost::geometry::strategy::buffer::join_round join_strategy(36);
    boost::geometry::strategy::buffer::distance_symmetric<double> distance_strategy(1.0);
    boost::geometry::strategy::buffer::end_round end_strategy(36);
    boost::geometry::strategy::buffer::side_straight side_strategy;
    boost::geometry::strategy::buffer::point_circle point_strategy;

    MultiLinestring l1;
    boost::geometry::read_wkt("MULTILINESTRING((11393 -19530,\
    -5728 30983,-9223372036854775807 15322,27608 14504),\
    (-32468 -20811,-27782 -14559,-30822 11140,-12550 27458),\
    (24176 -9103,4178 -868,7332 11648,21439 30360,-121 11529,8803 -10835,5660 20213))", l1);

    MultiPolygon result;

    boost::geometry::buffer(l1, result,
                            distance_strategy, side_strategy,
                            join_strategy, end_strategy, point_strategy);

    std::cout << boost::geometry::wkt(result) << std::endl;
    std::cout << boost::geometry::is_valid(result) << std::endl;
}
@barendgehrels
Copy link
Collaborator

This is probably an artificial testcase.
We might detect the -9223372036854775807 value, somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants