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

Remove geosphere from dependencies #235

Closed
mhpob opened this issue May 23, 2024 · 3 comments
Closed

Remove geosphere from dependencies #235

mhpob opened this issue May 23, 2024 · 3 comments

Comments

@mhpob
Copy link
Contributor Author

mhpob commented May 23, 2024

point_offset uses geosphere::destPoint as its main workhorse. point_offset says that it is calculating the great circle distance (assuming the Earth is a sphere) in its documentation, but it is not --geosphere::destPoint uses a geodesic (assuming the Earth is an ellipse) distance algorithm. There is a difference on the order of a few meters (<5) between these two techniques. @chrisholbrook is this an acceptable change? Great-circle distance is easy to hard code and would be dependency free. Geodesic distance is based on an optimizing function and would probably be best left to the compiled code in geosphere.

The distance in meters between resulting coords from the example using geodesic (current) and great circle (haversine, dependency-free) distance is:

[1] NA 0.3730123 0.5492174 0.6980811 0.8276335 0.9698963 1.1586693
[8] 1.3963796 1.6483109 1.8660119 2.0147364 2.0946781 2.1517980 2.2630914
[15] 2.4829321 2.7918899 3.1107809

Considering that the intent is for this seems to be a coarse gist of where the new point would be (you can only input cardinal directions), it seems that 3 meters difference would be okay.

Update: There can be substantial differences (2km) when we get into >1k km distances along an initial bearing.

mhpob added a commit to mhpob/glatos that referenced this issue May 24, 2024
@mhpob
Copy link
Contributor Author

mhpob commented Aug 19, 2024

#236 (comment)

@chrisholbrook
Copy link
Collaborator

completed in a20ca37

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