[Proj] bug in PJ_tmerc.c ?

Gerald Evenden gerald.evenden at verizon.net
Wed Jun 1 17:02:55 EDT 2005


For quick fix see below.  The test line does not belong there at all 
since the
correction for lat_0 offset is done two lines earlier.  I will do more 
elaborate
tests later.

What took me a minute to figure things out was your specifying both
+a and +b which caused me to assume you were doing an ellipsoid
which does not seem to have this problem.  +R= makes things clearer.  
:-)
Yes, your code below shows spherical forms but sometimes I do not
read too good.  :-(

On Jun 1, 2005, at 9:19 AM, john star wrote:

>
> Hi,
>
> I think that if lat < 0, then there is a bug in PJ_tmerc.c:
> INVERSE(s_inverse); /* sphere */
> 	double h, g;
>
> 	h = exp(xy.x / aks0);
> 	g = .5 * (h - 1. / h);
> 	h = cos(P->phi0 + xy.y / aks0);
> 	lp.phi = asin(sqrt((1. - h * h) / (1. + g * g)));

> //	if ((xy.y + P->phi0) < 0.) lp.phi = -lp.phi; /* instead of if 
> ((xy.y) < 0.) lp.phi = -lp.phi;*/  <-------

> 	lp.lam = (g || h) ? atan2(g, h) : 0.;
> 	return (lp);
> }
_____________________________________
Jerry and the low riders: Daisy Mae and Joshua.
"The whole religious complexion of the modern world is due to the
absence from Jerusalem of a lunatic asylum." Havelock Ellis, 1914




More information about the Proj mailing list