diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-11-11 23:56:58 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-11-12 00:05:31 +0100 |
| commit | b38d0143a65fff72635b95a61ed6c4c41802889e (patch) | |
| tree | 31e8f7a2a015b56f48d3b4c81cd42ca39a0f2c90 /src/projections | |
| parent | d5b0ea29b694a24fb1a951f6fe557f2e1bf78e62 (diff) | |
| download | PROJ-b38d0143a65fff72635b95a61ed6c4c41802889e.tar.gz PROJ-b38d0143a65fff72635b95a61ed6c4c41802889e.zip | |
Polar stereographic at pole: make it return (0,0)
Due to the improved accuracy of pj_tsfn(), it no longer returns
0 when phi=90° due to the conversion in radians.
Some GDAL tests are very sensitive to the pole transforming to (0,0)
exactly, so add a special case for that.
master only
Diffstat (limited to 'src/projections')
| -rw-r--r-- | src/projections/stere.cpp | 5 |
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; } |
