[OSRS-PROJ] Weirdnesses in the source code

Gerald I. Evenden gerald.evenden at verizon.net
Tue Jul 8 13:15:05 EDT 2003

Thank-you for all the bug reports.  Imbedded are some comments prior
to looking in to them in detail:

On Tue, 2003-07-08 at 11:23, proj at ton.iguana.be wrote:
> Hi,
> I'm busy transforming some of the proj code to perl, and ran into a
> number of strange things.

On the HEAD stuff, the second quote set is informational and does
not affect execution, but they will be fixed.

> PJ_aeqd.c
>   in PROJ_HEAD, lat_0 should be lat_0=
> PJ_aitoff.c
>   in PROJ_HEAD, lat_1 should be lat_1=

Interesting.  Will look into it.
> In PJ_imw_p.c, the function loc_for
>   has a parameter double *yc that never gets actually set
>   (the else branch in the code has it's own local yc)
>   It is however used in e_inverse, so that basically picks up random
>   garbage from memory (whatever the local yc there gets as value)

Ah yes, I was buzz-sawing my way through this one and got a little
sloppy when it finally ran.  Will fix.  Does not affect functionality.

> PJ_lcca.c use errors 50 and 51, which don't exist. They are positive, 
> so maybe they are meant to pick up plain errno values, but in that case
> i don't know which ones you mean and it's not portable


> PJ_ocea.c, PROJ_HEAD basically declares Sphlonc (forgotten newline)

The following is apparently old code and does not match libproj4.
No longer supported.

> PJ_cea.c
> 	if (pj_param(P->params, "tlat_ts").i &&
> 		(P->k0 = cos(t = pj_param(P->params, "rlat_ts").f)) < 0.) E_ERROR(-24)
> 	else
> 		t = 0.;
>   P->k0 doesn't get set if pj_param(P->params, "tlat_ts").i isn't done.
>   It's however used.
>   For t=0 the corresponding k0 is 1, which is the default (except when
>   it gets explicitely set), so maybe it's what you want. But it at least 
>   deserves a comment in that case I'd say
>   PS, k0 seems nowhere explained in the docs. Shouldn't it be ?

Yes, yes, foolish code.  Dumb, dumb!  A thousand lashes.

> PJ_stere.c:
> 	P->phits = pj_param(P->params, "tlat_ts").i ?
> 		P->phits = pj_param(P->params, "rlat_ts").f : HALFPI;
>   Not exactly a bug, but the double assign to P->hits is weird. Probably 
>   meant to be:
> 	P->phits = pj_param(P->params, "tlat_ts").i ?
> 		pj_param(P->params, "rlat_ts").f : HALFPI;

Some people are *very* picky.  ;-)  Will fix.

> PJ_vandg2.c:
>   projection vandg2 itself only supports spherical, but forgets to set 
>   P->es to 0 (Yeah, i know it's not used in s_forward itself)

Sorry, I was working on this many years ago.  Got up to the point of
putting the base material in but later got side tracked.  I will remove
it.  Interesting generalization of the polyconic but quite complicated.

> PJ_mpoly.c:
>   always returns (0,0), so it doesn't do anything.
>   It's still linked into the final proj though.

pj_enfn no longer exists.  pj_authset no longer exists.  Check
liproj4 distribution.

> pj_enfn and pj_authset are handled inconsistently. Sometimes the 
> returncode gets checked, other times it's just assumed it will work.
> ---------------------------------------

Again, many thanks for the bug reports.  I really do appreciate them.

Gerald I. Evenden <gerald.evenden at verizon.net>

PROJ.4 Discussion List
See http://www.remotesensing.org/proj for subscription, unsubscription
and other information.

More information about the Proj mailing list