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

unwanted use of WGS84 ellipsoid parameters when using Mars ellipsoid parameters #1025

Closed
rouault opened this issue Jun 1, 2018 · 1 comment

Comments

@rouault
Copy link
Member

rouault commented Jun 1, 2018

Originally reported as OSGeo/gdal#665 , but can be reproduced with proj

$ echo "0 0 0" | src/cs2cs +proj=longlat +a=3396190 +b=3376200 +no_defs +to +proj=geocent +a=3396190 +b=3376200 +lon_0=0 +units=m +no_defs
3396190.00	0.00 0.00

which is expected. But doing the same with cct leads to

$ echo "0 0 0" | src/cct +proj=pipeline +step +proj=longlat +a=3396190 +b=3376200 +inv +step +proj=geocent +a=3396190 +b=3376200 +lon_0=0 +units=m
 6378137.0000         0.0000        0.0000           inf

We somehow use WGS84

Same with simplified

$ echo "0 0 0" | src/cct  +proj=geocent +a=3396190 +b=3376200 +lon_0=0 +units=m
 6378137.0000         0.0000        0.0000           inf
@kbevers
Copy link
Member

kbevers commented Jun 1, 2018

I haven't looked at the code yet but my spidey sense is tingling at the use of geocent with cct. geocent has special logic that only works in pj_transform() as far as I remember. It should be removed alongside proj_api.h.

For this sort of thing the correct operation to use is cart which works as intended:

echo "0 0 0" | cct  +proj=cart +a=3396190 +b=3376200 +lon_0=0 +units=m
 3396190.0000         0.0000        0.0000           inf

This needs to be documented.

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