Skip to content

Commit

Permalink
Fix error in implementation of Inverse ellipsoidal orthographic proje…
Browse files Browse the repository at this point in the history
…ction (oblique case) that cause convergence to sometimes fail (fixes #2844)
  • Loading branch information
rouault committed Sep 15, 2021
1 parent 47fb85b commit 3bd64e8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/projections/ortho.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ static PJ_LP ortho_e_inverse (PJ_XY xy, PJ *P) { /* Ellipsoidal, inver
const double J11 = -rho * sinphi * sinlam;
const double J12 = nu * cosphi * coslam;
const double J21 = rho * (cosphi * Q->cosph0 + sinphi * Q->sinph0 * coslam);
const double J22 = nu * Q->sinph0 * Q->cosph0 * sinlam;
const double J22 = nu * Q->sinph0 * cosphi * sinlam;
const double D = J11 * J22 - J12 * J21;
const double dx = xy.x - xy_new.x;
const double dy = xy.y - xy_new.y;
Expand Down
10 changes: 10 additions & 0 deletions test/gie/builtins.gie
Original file line number Diff line number Diff line change
Expand Up @@ -4531,6 +4531,16 @@ tolerance 0.1 mm
accept 0 -6343600
expect 0 -59.966377950099655436

-------------------------------------------------------------------------------
# Oblique
# Test case from https://github.com/OSGeo/PROJ/issues/2844
-------------------------------------------------------------------------------
operation +proj=ortho +ellps=WGS84 +lon_0=23.0 +lat_0=37.0
tolerance 0.1 mm
accept 120.0 84.0
expect 663929.0678 5118338.2423
roundtrip 1


-------------------------------------------------------------------------------
# Equatorial
Expand Down

0 comments on commit 3bd64e8

Please sign in to comment.