aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/projections/omerc.cpp2
-rw-r--r--test/gie/builtins.gie10
2 files changed, 12 insertions, 0 deletions
diff --git a/src/projections/omerc.cpp b/src/projections/omerc.cpp
index e07c209e..0de3aa7d 100644
--- a/src/projections/omerc.cpp
+++ b/src/projections/omerc.cpp
@@ -154,6 +154,8 @@ PJ *PROJECTION(omerc) {
phi1 = pj_param(P->ctx, P->params, "rlat_1").f;
lam2 = pj_param(P->ctx, P->params, "rlon_2").f;
phi2 = pj_param(P->ctx, P->params, "rlat_2").f;
+ if (fabs(phi1) > M_HALFPI || fabs(phi2) > M_HALFPI)
+ return pj_default_destructor(P, PJD_ERR_LAT_LARGER_THAN_90);
if (fabs(phi1 - phi2) <= TOL ||
(con = fabs(phi1)) <= TOL ||
fabs(con - M_HALFPI) <= TOL ||
diff --git a/test/gie/builtins.gie b/test/gie/builtins.gie
index 235771d5..49b135d9 100644
--- a/test/gie/builtins.gie
+++ b/test/gie/builtins.gie
@@ -4013,6 +4013,16 @@ operation +proj=omerc +lat_1=0.8 +a=6400000 +b=.4
-------------------------------------------------------------------------------
expect failure errno invalid_eccentricity
+-------------------------------------------------------------------------------
+operation +proj=omerc +lat_1=91
+-------------------------------------------------------------------------------
+expect failure errno lat_larger_than_90
+
+-------------------------------------------------------------------------------
+operation +proj=omerc +lat_2=91
+-------------------------------------------------------------------------------
+expect failure errno lat_larger_than_90
+
===============================================================================
Ortelius Oval