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

Possible s2_point_on_surface implementation #152

Closed
kylebutts opened this issue Dec 10, 2021 · 6 comments
Closed

Possible s2_point_on_surface implementation #152

kylebutts opened this issue Dec 10, 2021 · 6 comments

Comments

@kylebutts
Copy link
Contributor

Hi there,

I'm really excited about this package, especially the speed of s2 versus geos. One of my favorite functions in sf is the st_point_on_surface which always returns a point near the centroid that lies within the polygon. Is this possible in s2 as well?

@paleolimbot
Copy link
Collaborator

I'm glad you like the package! I'm not aware of an existing implementation in the S2 library but will keep this open as a reminder to look.

@paleolimbot
Copy link
Collaborator

I don't see anything specifically implemented for a S2Polygon, but we can link together a closest edge query and a centroid to get this implemented in the R package (a note-to-self, since I'm planning to spend some time on S2 in January).

@paleolimbot
Copy link
Collaborator

Just kidding...S2Polygon::Project(S2Polygon::Centroid()) will do this!

@kylebutts
Copy link
Contributor Author

I can submit a pull request with s2_point_on_surface() if you would welcome that request

@paleolimbot
Copy link
Collaborator

I'd love that if you feel up for it!

@kylebutts
Copy link
Contributor Author

See #161

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

2 participants