1 Jun 2005 15:19
bug in PJ_tmerc.c ?
john star <starjohn <at> hotmail.com>
2005-06-01 13:19:05 GMT
2005-06-01 13:19:05 GMT
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(Continue reading)
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;*/ <-------
RSS Feed