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

boost::geometry::buffer() of linestring returns inner polygon #1250

Closed
Raclamusi opened this issue Feb 27, 2024 · 3 comments
Closed

boost::geometry::buffer() of linestring returns inner polygon #1250

Raclamusi opened this issue Feb 27, 2024 · 3 comments
Assignees
Labels
Milestone

Comments

@Raclamusi
Copy link

I tried to compute the buffer of LINESTRING(3 2, 2 2, 2 4, 4 4, 4 2, 3 1) with a distance of 0.5, but did not get the expected result and instead got the inner polygon.
This problem does not occur with the reverse order linestring, LINESTRING(3 1, 4 2, 4 4, 2 4, 2 2, 3 2).

https://godbolt.org/z/Gfd85v5bG

Expected Result: MULTIPOLYGON(((2.79289 1.5,2 1.5,1.5 1.5,1.5 2,1.5 4,1.5 4.5,2 4.5,4 4.5,4.5 4.5,4.5 4,4.5 2,4.5 1.79289,4.35355 1.64645,3.35355 0.646447,2.64645 1.35355,2.79289 1.5),(3 1.70711,3.5 2.20711,3.5 3.5,2.5 3.5,2.5 2.5,3 2.5,3 1.70711)))
Result with boost-1.84.0: MULTIPOLYGON(((3 1.70711,3 2.5,2.5 2.5,2.5 3.5,3.5 3.5,3.5 2.20711,3 1.70711)))

Screenshot

@barendgehrels
Copy link
Collaborator

Thanks for the report, I can reproduce it. Not yet fixed by my last changes.

barendgehrels added a commit to barendgehrels/geometry that referenced this issue Feb 28, 2024
@barendgehrels
Copy link
Collaborator

It is fixed now. I jumped on it because the case is, geometrically, so simple, it should really not fail.
But apparently it was still a rare case, needing a condition which should always have been there.
Great you found it and reported it.

@barendgehrels barendgehrels added this to the 1.85 milestone Feb 28, 2024
barendgehrels added a commit that referenced this issue Mar 13, 2024
@barendgehrels
Copy link
Collaborator

The fix is merged, closing.

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

No branches or pull requests

2 participants