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

Incorrect result for Union (and touch, most likely other operations as well) when creating donut polygon. #112

Open
ewsterrenburg opened this issue Jan 6, 2025 · 0 comments

Comments

@ewsterrenburg
Copy link

ewsterrenburg commented Jan 6, 2025

image

polygon1, _ := geoencoding.Decode([]byte(`POLYGON((0 0,0 1,0 2,0 3,1 3,1 2,1 1,2 1,2 2,3 2,3 1,4 1,4 2,5 2,5 1,5 0,4 0,3 0,2 0,1 0,0 0))`), geoencoding.WKT)
polygon2, _ := geoencoding.Decode([]byte(`POLYGON((1 2,1 3,2 3,2 2,1 2))`), geoencoding.WKT)

strategy := planar.NormalStrategy()
i, e := strategy.Union(polygon1.Geom(), polygon2.Geom())
fmt.Println(i, e)

Provides both nil as result and nil as error, while the result should be the combined polygon (with a hole).

(unfortunately, my knowledge of Go is not sufficient to debug this myself and come up with a pull request).

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

No branches or pull requests

1 participant