aboutsummaryrefslogtreecommitdiff
path: root/src/projections/omerc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/projections/omerc.cpp')
-rw-r--r--src/projections/omerc.cpp4
1 files changed, 4 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)