Skip to content

Idiomatic way to find intersection between a circular shape and a polygon in s2geometry? #231

Answered by jmr
sreekanth-cb asked this question in Q&A
Discussion options

You must be logged in to vote

Well, it appears you're using the go version, but the principle is the same.

If you just have one polygon and one point, then S2Point projected = polygon.Project(cap_center); and test the distance between projected and cap_center. If you have multiple polygons and want to test if any are within the distance, then the idiomatic way is probably with an S2ShapeIndex, but that's more complicated.

Replies: 5 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by jmr
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@sreekanth-cb
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #228 on February 21, 2022 13:27.