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
invalid intersection for CCW polygons #1231
Comments
vissarion
changed the title
invalid inetrsection for CCW polygons
invalid intersection for CCW polygons
Jan 26, 2024
It's difference is also wrong, both clockwise and counterclockwise. |
barendgehrels
added a commit
to barendgehrels/geometry
that referenced
this issue
Mar 3, 2024
…and some test refactoring
barendgehrels
added a commit
that referenced
this issue
Mar 13, 2024
Fixed by #1263 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following program
returns the invalid geometry
MULTIPOLYGON(((3.33333 8.33333,0 5,-3.40491 -7.48466,-1.21132 -7.95472,5.31429 4.37143,5 5,0 1,4 6,5 5,3.33333 8.33333)))
while for CW polygons ie. if we change line
using Polygon = boost::geometry::model::polygon<Point, false>;
above with
using Polygon = boost::geometry::model::polygon<Point, true>;
it returns
MULTIPOLYGON(((3.33333 8.33333,5 5,5.31429 4.37143,-1.21132 -7.95472,-3.40491 -7.48466,0 5,3.33333 8.33333),(5 5,4 6,0 1,5 5)))
which is valid and correct.
This behavior is tested in 1.84 and also 1.78.
However, in 1.77 the above code gives the correct valid result in all cases.
The difference between the invalid and valid cases is that in the latter there is the creation of a hole
(5 5,4 6,0 1,5 5)
while in the former this is not true and the result is invalid. Notably the hole shares a point with the boundary of the output polygon.The text was updated successfully, but these errors were encountered: