aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/projections/airy.cpp4
-rw-r--r--test/gie/builtins.gie7
2 files changed, 10 insertions, 1 deletions
diff --git a/src/projections/airy.cpp b/src/projections/airy.cpp
index f7068061..ba6a40ff 100644
--- a/src/projections/airy.cpp
+++ b/src/projections/airy.cpp
@@ -79,6 +79,10 @@ static PJ_XY s_forward (PJ_LP lp, PJ *P) { /* Spheroidal, forward */
}
if (fabs(s = 1. - cosz) > EPS) {
t = 0.5 * (1. + cosz);
+ if(t == 0) {
+ proj_errno_set(P, PJD_ERR_TOLERANCE_CONDITION);
+ return xy;
+ }
Krho = -log(t)/s - Q->Cb / t;
} else
Krho = 0.5 - Q->Cb;
diff --git a/test/gie/builtins.gie b/test/gie/builtins.gie
index 49b135d9..3953a1b6 100644
--- a/test/gie/builtins.gie
+++ b/test/gie/builtins.gie
@@ -324,7 +324,7 @@ Airy
===============================================================================
-------------------------------------------------------------------------------
-operation +proj=airy +a=6400000 +lat_1=0 +lat_2=2
+operation +proj=airy +a=6400000
-------------------------------------------------------------------------------
tolerance 0.1 mm
accept 2 1
@@ -404,6 +404,11 @@ expect 0 0
accept 25 25
expect 0.3821 0.4216
+-------------------------------------------------------------------------------
+operation +proj=airy +R=1 +no_cut
+-------------------------------------------------------------------------------
+accept -180 0
+expect failure errno tolerance_condition
===============================================================================
Aitoff