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

within returns a wrong result with multi-linestrings #1238

Open
vissarion opened this issue Feb 5, 2024 · 0 comments
Open

within returns a wrong result with multi-linestrings #1238

vissarion opened this issue Feb 5, 2024 · 0 comments

Comments

@vissarion
Copy link
Member

The following program returns true while this is clearly not the case.

#include <boost/geometry.hpp>

int main() {
    using Point = boost::geometry::model::d2::point_xy<double>;
    using Linestring = boost::geometry::model::linestring<Point>;
    using MultiLinestring = boost::geometry::model::multi_linestring<Linestring>;

    MultiLinestring ml1, ml2;
    boost::geometry::read_wkt("MULTILINESTRING((10 10, 20 20 ), (15 15 , 30 15))", ml1);
    boost::geometry::read_wkt("MULTILINESTRING((10 10, 20 20), (60 -60, 30 15))", ml2);

    std::cout << boost::geometry::within(ml2, ml1) << std::endl;

    return 0;
}
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

1 participant