diff options
| -rw-r--r-- | src/projections/lcc.cpp | 4 | ||||
| -rw-r--r-- | test/gie/builtins.gie | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/projections/lcc.cpp b/src/projections/lcc.cpp index a1fe79a9..5eee0d14 100644 --- a/src/projections/lcc.cpp +++ b/src/projections/lcc.cpp @@ -108,6 +108,10 @@ PJ *PROJECTION(lcc) { if (secant) { /* secant cone */ sinphi = sin(Q->phi2); Q->n = log(m1 / pj_msfn(sinphi, cos(Q->phi2), P->es)); + if (Q->n == 0) { + // Not quite, but es is very close to 1... + return pj_default_destructor(P, PJD_ERR_ECCENTRICITY_IS_ONE_OR_GREATER); + } Q->n /= log(ml1 / pj_tsfn(Q->phi2, sinphi, P->e)); } Q->c = (Q->rho0 = m1 * pow(ml1, -Q->n) / Q->n); diff --git a/test/gie/builtins.gie b/test/gie/builtins.gie index b9680ca8..56724782 100644 --- a/test/gie/builtins.gie +++ b/test/gie/builtins.gie @@ -2677,6 +2677,11 @@ direction inverse accept 131824.206082557 267239.875053699 expect 1 2 +------------------------------------------------------------------------------- +operation +proj=lcc +a=9999999 +b=.9 +lat_2=1 +------------------------------------------------------------------------- +expect failure errno eccentricity_is_one + =============================================================================== Lambert Conformal Conic Alternative Conic, Sph&Ell |
