aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPROJ-BOT <59655370+PROJ-BOT@users.noreply.github.com>2020-04-15 00:17:56 +0200
committerGitHub <noreply@github.com>2020-04-15 00:17:56 +0200
commit70aebec863f63fdec7f86961dfa9b7924b9ab2dc (patch)
tree917fc35e47145e179da9c048f02009e0057e29a9
parentd462db642c59f58950d1ba26d2998263c10c4ee8 (diff)
downloadPROJ-70aebec863f63fdec7f86961dfa9b7924b9ab2dc.tar.gz
PROJ-70aebec863f63fdec7f86961dfa9b7924b9ab2dc.zip
Robinson inverse projection: error on out of domain values (fixes #2151)
-rw-r--r--src/projections/robin.cpp5
-rw-r--r--test/gie/builtins.gie7
2 files changed, 9 insertions, 3 deletions
diff --git a/src/projections/robin.cpp b/src/projections/robin.cpp
index 3c4d9f07..8b646502 100644
--- a/src/projections/robin.cpp
+++ b/src/projections/robin.cpp
@@ -142,6 +142,10 @@ static PJ_LP robin_s_inverse (PJ_XY xy, PJ *P) { /* Spheroidal, invers
lp.phi = (5 * i + t) * DEG_TO_RAD;
if (xy.y < 0.) lp.phi = -lp.phi;
lp.lam /= V(X[i], t);
+ if( fabs(lp.lam) > M_PI ) {
+ proj_errno_set(P, PJD_ERR_LAT_OR_LON_EXCEED_LIMIT);
+ lp = proj_coord_error().lp;
+ }
}
return lp;
}
@@ -155,4 +159,3 @@ PJ *PROJECTION(robin) {
return P;
}
-
diff --git a/test/gie/builtins.gie b/test/gie/builtins.gie
index 1c5eb3be..24c5ac35 100644
--- a/test/gie/builtins.gie
+++ b/test/gie/builtins.gie
@@ -2327,7 +2327,7 @@ Krovak
===============================================================================
-------------------------------------------------------------------------------
-operation +proj=krovak +ellps=GRS80
+operation +proj=krovak +ellps=GRS80
-------------------------------------------------------------------------------
tolerance 0.1 mm
accept 2 1
@@ -3666,7 +3666,7 @@ Nell-Hammer
===============================================================================
-------------------------------------------------------------------------------
-operation +proj=nell_h +a=6400000
+operation +proj=nell_h +a=6400000
-------------------------------------------------------------------------------
tolerance 0.1 mm
accept 2 1
@@ -4833,6 +4833,9 @@ expect 0 -89.5
accept 0.000000000000 -8654720.000000000000
expect 0 -90
+accept 17250000 100000
+expect failure errno lat_or_lon_exceed_limit
+
===============================================================================
Roussilhe Stereographic