diff options
| author | Martin Raspaud <martin.raspaud@smhi.se> | 2020-04-14 22:09:40 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-14 22:09:40 +0200 |
| commit | 767a9976587491f3a90b744376f8d5601c803e4b (patch) | |
| tree | b10c1bf55fb09a6775015afea268f825f967388d | |
| parent | 5d94742cd774b5e6f8d45043a01f8c69dcbbe73c (diff) | |
| download | PROJ-767a9976587491f3a90b744376f8d5601c803e4b.tar.gz PROJ-767a9976587491f3a90b744376f8d5601c803e4b.zip | |
Robinson inverse projection: error on out of domain values (#2151)
| -rw-r--r-- | src/projections/robin.cpp | 5 | ||||
| -rw-r--r-- | test/gie/builtins.gie | 7 |
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 |
