[Proj] bug in PJ_tmerc.c ?

Gerald Evenden gerald.evenden at verizon.net
Wed Jun 1 10:42:00 EDT 2005


I think you have a point.

I can't think of any case where a negative grid value was ever used as
a test point.  Interesting.

For the test data of

0.0 -35583
0. 0.
0.0 35583

should output:

11d4'1.376"E    52d48'0.015"N
11d4'1.376"E    53d7'10.746"N
11d4'1.376"E    53d26'21.478"N

but the N-S sign of the first value is incorrectly output as S in the  
current
version.  The sign of northing is incorrectly filtering through to the  
output latitude.

Will be fixed.

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);
> }
>
> You can see it like: (flips between southern and northern hemisphere  
> around the center)
> D:\geotiffBin>proj.exe +proj=tmerc +lat_0=53.119651794  
> +lon_0=11.067049026 +k=1.000000 +x_0=0.000 +y_0=0.000 +a=6378137.000  
> +b=6378137.000 +to_meter=1.0000000000 -I
> 0.0 -35583
> 11d4'1.376"E    52d48'0.015"S
> 0.0 35583
> 11d4'1.376"E    53d26'21.478"N
>
> and see it also on
> http://modules.geotools.org/main/xref/org/geotools/referencing/ 
> operation/projection/TransverseMercator.html
>
> is it possible to see if it is correct and fix it in the next version  
> of libproj ?
>
> Thanks
>
>
> _______________________________________________
> Proj mailing list
> Proj at xserve.flids.com
> http://xserve.flids.com/mailman/listinfo/proj
>
>
_____________________________________
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