diff options
| author | Frank Warmerdam <warmerdam@pobox.com> | 2013-10-21 20:56:49 +0000 |
|---|---|---|
| committer | Frank Warmerdam <warmerdam@pobox.com> | 2013-10-21 20:56:49 +0000 |
| commit | dea2d656c4ca658239cb3d4d300c47b2477eb2ba (patch) | |
| tree | 8c3be0cbdb745047a904fef798558820587b9294 | |
| parent | ba401f0f66990d9ac69764b156646df907283933 (diff) | |
| download | PROJ-dea2d656c4ca658239cb3d4d300c47b2477eb2ba.tar.gz PROJ-dea2d656c4ca658239cb3d4d300c47b2477eb2ba.zip | |
Change handling of values nearly 90degrees away from the origin (#114)
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@2400 4e78687f-474d-0410-85f9-8d5e500ac6b2
| -rw-r--r-- | ChangeLog | 3 | ||||
| -rwxr-xr-x | nad/testvarious | 11 | ||||
| -rw-r--r-- | nad/tv_out.dist | 4 | ||||
| -rw-r--r-- | src/PJ_omerc.c | 7 |
4 files changed, 23 insertions, 2 deletions
@@ -1,5 +1,8 @@ 2013-10-21 Frank Warmerdam <warmerdam@pobox.com> + * src/PJ_omerc.c: Change handling of values nearly 90degrees away from + the origin (#114). + * src/pj_datums.c: Switch to using EPSG:1618 COORD_OP_CODE to transform hermannskogel to WGS84 (same as used to ETRS89) (#207). diff --git a/nad/testvarious b/nad/testvarious index e6b319ad..fa02d145 100755 --- a/nad/testvarious +++ b/nad/testvarious @@ -528,6 +528,17 @@ $EXE -f '%.14f' \ -E >>${OUT} <<EOF 16.33 48.20 EOF +echo "##############################################################" >> ${OUT} +echo "Test omerc sensitivity with locations 90d from origin(#114)" >> ${OUT} +# +$EXE -f '%.14f' \ + +proj=latlong +ellps=WGS84 \ + +to +proj=omerc +ellps=WGS84 +lon_1=62.581150 +lat_1=74.856102 \ + +lon_2=53.942810 +lat_2=74.905884 +units=km +no_rot +no_defs \ + -E >>${OUT} <<EOF +56.958381652832 72.8798 +56.9584 72.8798 +EOF ############################################################################## # Done! # do 'diff' with distribution results diff --git a/nad/tv_out.dist b/nad/tv_out.dist index f4153ba2..590d3321 100644 --- a/nad/tv_out.dist +++ b/nad/tv_out.dist @@ -251,3 +251,7 @@ Test inverse handling ############################################################## Test MGI datum gives expected results (#207) 16.33 48.20 595710.37321015028283 5357598.46457545924932 -44.49510847218335 +############################################################## +Test omerc sensitivity with locations 90d from origin(#114) +56.958381652832 72.8798 -9985.16336452572614 -227.67701050320997 0.00000000000000 +56.9584 72.8798 9985.16263662453457 -227.67701050313340 0.00000000000000 diff --git a/src/PJ_omerc.c b/src/PJ_omerc.c index c8888a83..3529b73c 100644 --- a/src/PJ_omerc.c +++ b/src/PJ_omerc.c @@ -48,8 +48,11 @@ FORWARD(e_forward); /* ellipsoid */ F_ERROR; v = 0.5 * P->ArB * log((1. - U)/(1. + U)); temp = cos(P->B * lp.lam); - u = (fabs(temp) < TOL) ? P->AB * lp.lam : - P->ArB * atan2((S * P->cosgam + V * P->singam) , temp); + if(fabs(temp) < TOL) { + u = P->A * lp.lam; + } else { + u = P->ArB * atan2((S * P->cosgam + V * P->singam), temp); + } } else { v = lp.phi > 0 ? P->v_pole_n : P->v_pole_s; u = P->ArB * lp.phi; |
