[Proj] bug in PJ_tmerc.c ?

john star starjohn at hotmail.com
Wed Jun 1 09:19:05 EDT 2005


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





More information about the Proj mailing list