diff options
| -rw-r--r-- | src/projections/omerc.cpp | 4 | ||||
| -rw-r--r-- | test/gie/builtins.gie | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/projections/omerc.cpp b/src/projections/omerc.cpp index c0278043..e07c209e 100644 --- a/src/projections/omerc.cpp +++ b/src/projections/omerc.cpp @@ -201,6 +201,10 @@ PJ *PROJECTION(omerc) { L = pow(pj_tsfn(phi2, sin(phi2), P->e), Q->B); F = Q->E / H; p = (L - H) / (L + H); + if( p == 0 ) { + // Not quite, but es is very close to 1... + return pj_default_destructor(P, PJD_ERR_INVALID_ECCENTRICITY); + } J = Q->E * Q->E; J = (J - L * H) / (J + L * H); if ((con = lam1 - lam2) < -M_PI) diff --git a/test/gie/builtins.gie b/test/gie/builtins.gie index 8e82979e..631767a3 100644 --- a/test/gie/builtins.gie +++ b/test/gie/builtins.gie @@ -4005,6 +4005,11 @@ operation +proj=omerc +lat_1=0.1 +a=6400000 +b=1 ------------------------------------------------------------------------------- expect failure errno invalid_eccentricity +------------------------------------------------------------------------------- +operation +proj=omerc +lat_1=0.8 +a=6400000 +b=.4 +------------------------------------------------------------------------------- +expect failure errno invalid_eccentricity + =============================================================================== Ortelius Oval |
