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

Allow VariableBuffer to take in BufferParameters? #992

Open
WindingWinter opened this issue Jul 20, 2023 · 5 comments
Open

Allow VariableBuffer to take in BufferParameters? #992

WindingWinter opened this issue Jul 20, 2023 · 5 comments

Comments

@WindingWinter
Copy link

Similar to Buffer, I think VariableBuffer should also be able to take in BufferParameters as an argument.

This is because I want to use one side buffering for VariableBuffer also. The method Buffer(Geometry, Double[]) would be an ideal extension to take in the BufferParameters

@dr-jts
Copy link
Contributor

dr-jts commented Jul 20, 2023

Unfortunately VariableBuffer uses a different technique than the Buffer algorithm, and it is not obvious how to adapt it to produce single-sided buffer output.

@WindingWinter
Copy link
Author

WindingWinter commented Jul 20, 2023 via email

@dr-jts
Copy link
Contributor

dr-jts commented Jul 20, 2023

What if I only want to buffer polygons on one side, but not on the other?

For buffering polygons, can you simply compute the difference (or intersection) of the polygon and the buffer to get the outside (or inside) buffer?

@WindingWinter
Copy link
Author

WindingWinter commented Jul 20, 2023 via email

@dr-jts
Copy link
Contributor

dr-jts commented Jul 20, 2023

Oh, I see, you were talking about buffering a line. In that case, your technique will work, as long as the line doesn't self-intersect too much, and the endpoints are not too close to the rest of the line. So for many cases, this will work, but it's not a fully general solution.

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

No branches or pull requests

2 participants