Skip to content

Commit

Permalink
Merge 8ae2f83 into c16c23a
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Apr 16, 2019
2 parents c16c23a + 8ae2f83 commit 64bd45f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/projections/omerc.cpp
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions test/gie/builtins.gie
Expand Up @@ -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
Expand Down

0 comments on commit 64bd45f

Please sign in to comment.