From 56938d961134e435372eed15f64fb5965953170d Mon Sep 17 00:00:00 2001 From: Frank Warmerdam Date: Thu, 6 Dec 2007 13:16:18 +0000 Subject: in the case of phi=90, the derived should be calculated at [90-delta,90] instead of at [90,90+delta] (the same is true for -90) #1605. git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1415 4e78687f-474d-0410-85f9-8d5e500ac6b2 --- src/pj_factors.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/pj_factors.c b/src/pj_factors.c index 32021b89..1911a2ae 100644 --- a/src/pj_factors.c +++ b/src/pj_factors.c @@ -20,15 +20,16 @@ pj_factors(LP lp, PJ *P, double h, struct FACTORS *fac) { return 1; } else { /* proceed */ errno = pj_errno = 0; - if (fabs(t) <= EPS) /* adjust to pi/2 */ - lp.phi = lp.phi < 0. ? -HALFPI : HALFPI; + if (h < EPS) + h = DEFAULT_H; + if (fabs(lp.phi) > (HALFPI - h)) + /* adjust to value around pi/2 where derived still exists*/ + lp.phi = lp.phi < 0. ? (-HALFPI+h) : (HALFPI-h); else if (P->geoc) lp.phi = atan(P->rone_es * tan(lp.phi)); lp.lam -= P->lam0; /* compute del lp.lam */ if (!P->over) lp.lam = adjlon(lp.lam); /* adjust del longitude */ - if (h <= 0.) - h = DEFAULT_H; if (P->spc) /* get what projection analytic values */ P->spc(lp, P, fac); if (((fac->code & (IS_ANAL_XL_YL+IS_ANAL_XP_YP)) != -- cgit v1.2.3