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

Clarification: Cartesian vs. geocentric #575

Closed
busstoptaktik opened this issue Sep 24, 2017 · 0 comments
Closed

Clarification: Cartesian vs. geocentric #575

busstoptaktik opened this issue Sep 24, 2017 · 0 comments
Assignees

Comments

@busstoptaktik
Copy link
Member

busstoptaktik commented Sep 24, 2017

There seems to be some discrepancy in the code regarding the meaning of “geocentric”, and the use of the PJ->geoc flag versus the PJ->is_geocent flag.

Traditionally, proj.c allowed the use of the “+geoc” flag, to indicate that input latitudes are geocentric, rather than geographic. This is handled in pj_init_ctx, so +geoc can be set on any PJ object.

The conversions of geocentric to/from geographic latitude is handled in pj_fwd/pj_inv:

        else if (P->geoc)   /* Maybe redundant and never used. */
            lp.phi = atan(P->rone_es * tan(lp.phi));

resp.

        if (P->geoc && fabs(fabs(lp.phi)-M_HALFPI) > EPS)
            lp.phi = atan(P->one_es * tan(lp.phi));

I think we can safely drop the comment “maybe redundant and never used”: The possibility of using geocentric latitudes has always been available, and while probably not seen in the wild very often, the overhead of supporting it is marginal, and we are sure to break user code in hard-to-debug places if dropping it.

Hence, I think the “maybe redundant...” comment should be dropped, since it invites to consideration of dropping the support of geocentric latitudes.

The other aspect of geocentricity is the use of the name “geocent” and the word “geocentric” in pj_geocent.c (which really should be called PJ_geocent.c). Here, what is really meant with geocentric is “cartesian”. I have put some comments about this in PJ_cart.c, but the overall split of pj_geocent.c and the material in geocent.c is hard to understand. I think we should clean up and make sure geocentric latitudes and cartesian coordinates are not confused so easily.

I would not mind taking the lead on this, but I would appreciate some comments from anyone having a clue about what goes on in these parts of the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant