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

Coordinate conversions proposal #191

Open
MarkWieczorek opened this issue Apr 17, 2024 · 0 comments
Open

Coordinate conversions proposal #191

MarkWieczorek opened this issue Apr 17, 2024 · 0 comments
Labels
enhancement Idea or request for a new feature

Comments

@MarkWieczorek
Copy link
Contributor

I propose that we introduce a new set of unified coordinate conversion routines for translating between geodetic, spherical, ellipsoidal-harmonic and cartesian coordinates. These would partially replace those that exist, and would introduce a more uniform logic for Boule. All coordinate transformations would require knowledge of the ellipsoid parameters and are hence appropriate for this project.

geodetic, spherical, and ellipsoidal-harmonic conversions

These routines would convert between "latitude" and "height" above the ellipsoid. Latitude would be geodetic, spherical or reduced (for ellipsoidal-harmonic coordinates). Height would be geodetic height (ellipsoidal height) or spherical height (height above the ellipsoid along the radius vector direction). Ellipsoidal-harmonic coordinate don't use a height, but instead use "u", which is the ellipsoid semiminor axis that passes through the point.

None of these routines require longitude, as the longitude is the same for all coordinate systems:

spherical_latitude, spherical_height = geodetic_to_spherical(latitude, height)   
latitude, height = spherical_to_geodetic(spherical_latitude, spherical_height) 
reduced_latitude, u = geodetic_to_ellipsoidal_harmonic(latitude, height)   
latitude, height = ellipsoidal_harmonic_to_geodetic(reduced_latitude, u)
reduced_latitude, u = spherical_to_ellipsoidal_harmonic(spherical_latitude, spherical_height)
spherical_latitude, spherical_height = ellipsoidal_harmonic_to_spherical(reduced_latitude, u)

One could potentially simplify these routines by considering the height as an optional parameter with a default of zero, and the parameter u as an optional parameter with a default of semiminor_axis.

Cartesian conversions

Conversion to and from cartesian coordinates require knowledge of the longitude.

x, y, z = geodetic_to_cartesian(longitude, latitude, height)
x, y, z = spherical_to_cartesian(longitude, spherical_latitude, spherical_height)
x, y, z = ellipsoidal_harmonic_to_cartesian(longitude, reduced_latitude, u)
longitude, latitude, height = cartesian_to_geodetic(x, y, z)
longitude, spherical_latitude, spherical_height = cartesian_to_spherical(x, y, z)
longtidue, reduced_latitude, u = cartesian_to_ellipsoidal_harmonic(x, y, z)

To simplify these functions, one could consider the height and u parameters as optional.

Comments

  • There was a discussion earlier about deprecating some coordinate transforms and moving these to pymap3d (Deprecate the coordinate conversion methods #126). What is being proposed here is somewhat different: In that discussion, the spherical coordinates were latitude and radius, which didn't depend on knowledge of the ellipsoid (see als Add methods to convert from geodetic and spherical coordinates to Cartesian coordinats #165). Here they are latitude and spherical height, which do require knowledge of the ellipsoid
  • At the present time, there is no easy way to convert from geodetic to spherical latitude, which is probably the most commonly used conversion. This was because you needed to input the latitude and radius, and radius needed to be computed by another function. What is proposed here rectifies this problem.
  • Even if some of these functions could be implemented in pymap3d instead of here, pymap3d does not have all of the ellipsoids that we have. This would complicate any such conversion. Furthermore, as far as i can tell, pymap3d doesn't really implement the above routines when height above the ellipsoid is non-zero.
  • This would be a breaking change.

Are you willing to help implement and maintain this feature?
Yes, but I am not sure when I will get around to it. Help (even for just 1 of the above) would be appreciated!

@MarkWieczorek MarkWieczorek added the enhancement Idea or request for a new feature label Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Idea or request for a new feature
Projects
None yet
Development

No branches or pull requests

1 participant