Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 7.0] Fix Robinson inverse projection #2154

Merged
merged 1 commit into from
Apr 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/projections/robin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -155,4 +159,3 @@ PJ *PROJECTION(robin) {
return P;
}


7 changes: 5 additions & 2 deletions test/gie/builtins.gie
Original file line number Diff line number Diff line change
Expand Up @@ -2327,7 +2327,7 @@ Krovak
===============================================================================

-------------------------------------------------------------------------------
operation +proj=krovak +ellps=GRS80
operation +proj=krovak +ellps=GRS80
-------------------------------------------------------------------------------
tolerance 0.1 mm
accept 2 1
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down