Skip to content

Mapproject -E and -I #8717

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

Closed
MarceloBanik opened this issue Apr 18, 2025 · 3 comments · Fixed by #8720
Closed

Mapproject -E and -I #8717

MarceloBanik opened this issue Apr 18, 2025 · 3 comments · Fixed by #8720
Labels
bug Something isn't working

Comments

@MarceloBanik
Copy link
Contributor

Description of the problem
mapproject coordinate transformation fails close to the pole

Appears to be related with commit 7825ff4
and
https://forum.generic-mapping-tools.org/t/mapproject-e-and-i/4483

Full script that generated the error

expected result

$ echo "0 0 -6356752.31425" | gmt mapproject -E -I --FORMAT_FLOAT_OUT=%.5f | gmt mapproject -E --FORMAT_FLOAT_OUT=%.5f
0.00000 0.00000 -6356752.31425

unexpected result

$ echo "1e-12 0 -6356752.31425" | gmt mapproject -E -I --FORMAT_FLOAT_OUT=%.5f | gmt mapproject -E --FORMAT_FLOAT_OUT=%.5f
0.00000 0.00000 26510.07216

Expected outcome

0.00000 0.00000 -6356752.31425
(or something very close to it)

System information

  • Operating system: Ubuntu 22.04.5 LTS
  • GMT version (gmt --version): 6.6.0_9a8769f_2025.04.12
@MarceloBanik MarceloBanik added the bug Something isn't working label Apr 18, 2025
@joa-quim
Copy link
Member

Indeed. Want to sneak in the code trying to fix this pole case?

@MarceloBanik
Copy link
Contributor Author

Here's my suggestion with some inspiration from Geocentric::IntReverse in geographiclib (https://geographiclib.sourceforge.io/).

gmt_diff.txt

@joa-quim
Copy link
Member

Thanks. I'm busy the next few days so I'll give it a test later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants