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

s2_centroid() and s2_centroid_agg() should normalize points (or PointGeography() should normalize them on input) #119

Closed
paleolimbot opened this issue Jun 4, 2021 · 0 comments

Comments

@paleolimbot
Copy link
Collaborator

This affects a distance calculation (and probably other point operations:

library(s2)

geog <- as_s2_geography(c("POINT (45.867 11.972)", "POINT (45.867 11.972)"))
centroid <- s2_centroid_agg(geog)

s2_distance(geog, centroid)
#> [1] 6671706 6671706
s2_distance(geog, s2_as_text(centroid))
#> [1] 0 0

Created on 2021-06-04 by the reprex package (v2.0.0)

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