-
Notifications
You must be signed in to change notification settings - Fork 70
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
Compute distances in geodetic coordinates #154
Comments
I can help |
That would be great @birocoles! |
Awesome! I couldn't find any closed-form expression for computing the Euclidean distance between two points defined in geocentric coordinates on the papers mentioned above. What I mean is that for computing the Euclidean distance both papers somewhat convert the coordinates to spherical and then compute the distance. @birocoles, are you aware of a closed-form expression for it? |
The closed form is very ugly. It can be found at Vajda et al (2004), eq 15. Apparently, transforming coordinates to Cartesian and then compute the distance is more efficient. But it should be investigated. |
Thanks @birocoles for the reference. It seems they are just converting to Cartesian (no projecting, Cartesian coordinates with the origin on the center of the Earth) and then replacing the My intuition tells me this:
|
I think we need to implement both formulas and use them not only for comparing the computation times, but also the results. The results must be the same. What do you think? |
That's a very good idea. |
@birocoles Would you like to tackle this (if you have time, obviously)? If not, don't worry, I can start writing the PR and we can continue the discussion over there. Again, no hurries. |
Ok @santisoler , I can tackle this. I will include more functions for converting coordinates in |
Add `boule.Ellipsoid.prime_vertical_radius` (usually represented by N) instead of calculating it in the coordinate conversion method. This is useful in other areas (e.g. fatiando/harmonica#154). Method uses pre-computed sine of latitude to avoid repeated computations of sines in other methods using this. The definition is from Vermeille (2002; https://doi.org/10.1007/s00190-002-0273-6) and Vajda (2004).
Description of the desired feature
Currently Harmonica has functions to compute distances between points defined in Cartesian coordinates or in spherical geocentric coordinates. Would be nice if we add a function to compute Euclidean distances between points whose coordinates are defined in geodetic (ellipsoidal) coordinates (don't confuse it with great circle distances).
Worth noting that the geodetic coordinates depend on the reference ellipsoid, so we would need to pass a
boule.Ellipsoid
to the new function along with the coordinates of the two points.This may allow to compute gravitational and magnetic effects of point masses directly on geodetic coordinates without the need to convert them into spherical. Also it could enable us to build a separate equivalent layer class, a
EQLHarmonicGeodetic
for example, that interpolates harmonic data given in geodetic coordinates.Some articles that may give insights of how to compute such distances are:
Are you willing to help implement and maintain this feature? Yes
The text was updated successfully, but these errors were encountered: