Open ctessum opened 6 years ago
Yep, it is totally acceptable. ;-)
e7cfa0c added Polygon.Contains and Polygon.Intersects. To clarify, you're after the equivalent of C++'s S2Polygon::InitToIntersection
?
Yes, I mean the equivalent of S2Polygon::InitToIntersection
. Thanks!
I'm interested in contributing a PR for this — are there any thoughts on using Martinez-Rueda for the boolean operation algorithm? Or would it be best to port the C++ version accordingly?
There is a port of (one of) the Martinez-Rueda algorithms here. However, that one is for planar geometry, not sure that it would work here?
@ctessum I'm not sure myself. The projection onto a plane would conserve intersection points but not lengths.. is it naive to assume the lengths are proportional and thus area is conserved after we project back to the sphere?
any update on this? Curious if anyone is actively working on this piece?
@alphairys I don't have an update/I haven't been working on it. If you're looking for a workaround, I've been using CellUnions (after covering the polygon with cells) as a workaround, and they implement simple binary operations like CellUnionFromIntersection.
There is still work being done on this
I think someone has already done that https://github.com/davidreynolds/gos2/blob/master/s2/polygon_test.go
Since it seems acceptable to use this space to indicate interest in specific features, I would like to request polygon intersections. The Go language currently lacks a high quality library for boolean operations on geographic features, and having one would help me out greatly. (I am one of the maintainers of a low-to-medium quality library.) I greatly appreciate all the work that has happened so far to port this library to Go.