You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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));
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.
The text was updated successfully, but these errors were encountered:
There seems to be some discrepancy in the code regarding the meaning of “geocentric”, and the use of the
PJ->geoc
flag versus thePJ->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:
resp.
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.
The text was updated successfully, but these errors were encountered: