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

linestring buffer with rgeo and geos #71

Open
tagliala opened this issue May 23, 2014 · 0 comments
Open

linestring buffer with rgeo and geos #71

tagliala opened this issue May 23, 2014 · 0 comments
Labels

Comments

@tagliala
Copy link

For a project I'm working on, I needed a buffer around a linestring. I'm using rgeo 0.3.20 + geos 3.4.2 on osx 10.9

this is a snippet of my ruby code:

factory = RGeo::Geographic.simple_mercator_factory(buffer_resolution: 2)
line_string = factory.line_string(points)
line_string_buffer = line_string.buffer(3000)

Most of the times, the result of the above is a POLYGON, other few times is an "odd" MULTIPOLYGON:

Examples: http://jsfiddle.net/tagliala/2qu9f/ and http://jsfiddle.net/tagliala/LhSx6/

(The only difference is a point added to the linestring. You could zoom in to see that)

Is there a way to always obtain a polygon?

I tried to increase the buffer resolution to 8 and it fixes the problem for this specific case, but I'm afraid it isn't a proper solution. Moreover, my application doesn't need so much precision.

Thanks In Advance

PS: to be honest, I also asked on the rgeo-users group and stackoverflow but there seems to be very low visibility, 9 total views (including me) in 7 days.

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