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

creating buffer around point #121

Open
rayhaanq opened this issue Mar 9, 2019 · 2 comments
Open

creating buffer around point #121

rayhaanq opened this issue Mar 9, 2019 · 2 comments

Comments

@rayhaanq
Copy link

rayhaanq commented Mar 9, 2019

Hi, I was just wondering if it would be possible to create a buffer around a point. How would you implement this with this library? This would be the equivalent of ST_Buffer

@aryehlev
Copy link

aryehlev commented Nov 5, 2021

#206

@twpayne
Copy link
Owner

twpayne commented Nov 17, 2021

Creating a buffer around a single point is relatively straightforward: the resulting geometry is a circle (likely simplified to a polygon with an appropriate number of points).

ST_Buffer is significantly more complicated to implement as it works on arbitrary geometries. As a simple example, ST_Buffer around two identical points returns a single circle (possibly simplified to polygon), ST_Buffer around two neighboring points returns the union of two overlapping circles (still representable as a polygon), and ST_Buffer around two well-separated points returns two non-overlapping circles (now only representable as a multipolygon).

If you need this functionality, GEOS is a tried and tested library for these operations. go-geos provides Go bindings to it, but comes with many caveats. This is not an easy problem.

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

3 participants