aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-11-12 11:46:38 +0100
committerGitHub <noreply@github.com>2020-11-12 11:46:38 +0100
commit1a98229ed2c738bd563122084a08d36b2bf0ebaf (patch)
tree31e8f7a2a015b56f48d3b4c81cd42ca39a0f2c90 /src
parentd5b0ea29b694a24fb1a951f6fe557f2e1bf78e62 (diff)
parentb38d0143a65fff72635b95a61ed6c4c41802889e (diff)
downloadPROJ-1a98229ed2c738bd563122084a08d36b2bf0ebaf.tar.gz
PROJ-1a98229ed2c738bd563122084a08d36b2bf0ebaf.zip
Merge pull request #2422 from rouault/fix_polar_stere_at_pole
Polar stereographic at pole: make it return (0,0)
Diffstat (limited to 'src')
-rw-r--r--src/projections/stere.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/projections/stere.cpp b/src/projections/stere.cpp
index abc4aa13..3fff722d 100644
--- a/src/projections/stere.cpp
+++ b/src/projections/stere.cpp
@@ -86,7 +86,10 @@ static PJ_XY stere_e_forward (PJ_LP lp, PJ *P) { /* Ellipsoidal, forwar
sinphi = -sinphi;
/*-fallthrough*/
case N_POLE:
- xy.x = Q->akm1 * pj_tsfn (lp.phi, sinphi, P->e);
+ if( fabs(lp.phi - M_HALFPI) < 1e-15 )
+ xy.x = 0;
+ else
+ xy.x = Q->akm1 * pj_tsfn (lp.phi, sinphi, P->e);
xy.y = - xy.x * coslam;
break;
}