aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Knudsen <thokn@sdfe.dk>2018-02-10 14:57:50 +0100
committerThomas Knudsen <thokn@sdfe.dk>2018-02-10 14:57:50 +0100
commit3c62e6e7263b3a0e6e2397db5b43607f4b7fbe1d (patch)
tree1ae595f53d40382bb0281307ac09b4bcf7f28f45 /src
parent8a407d59d4aa657415a4cfd3069206f5839e6470 (diff)
downloadPROJ-3c62e6e7263b3a0e6e2397db5b43607f4b7fbe1d.tar.gz
PROJ-3c62e6e7263b3a0e6e2397db5b43607f4b7fbe1d.zip
Handle sign convention for vertical datum shifts
Also make corresponding sign corrections in a number of tests, and comment out a few tests which work correctly, but report failure since gie is not yet ready to handle unusual axis orders in cases with angular output coordinates.
Diffstat (limited to 'src')
-rw-r--r--src/gie.c9
-rw-r--r--src/pj_fwd.c4
-rw-r--r--src/pj_inv.c4
3 files changed, 12 insertions, 5 deletions
diff --git a/src/gie.c b/src/gie.c
index 8d0404b2..95f50708 100644
--- a/src/gie.c
+++ b/src/gie.c
@@ -842,10 +842,17 @@ Tell GIE what to expect, when transforming the ACCEPTed input
if (T.verbosity > 3)
printf ("GOT %.12f %.12f %.12f %.12f\n", co.v[0],co.v[1],co.v[2],co.v[3]);
+#if 0
+ /* We need to handle unusual axis orders - that'll be an item for version 5.1 */
+ if (T.P->axisswap) {
+ ce = proj_trans (T.P->axisswap, T.dir, ce);
+ co = proj_trans (T.P->axisswap, T.dir, co);
+ }
+#endif
if (proj_angular_output (T.P, T.dir))
d = proj_lpz_dist (T.P, ce.lpz, co.lpz);
else
- d = proj_xyz_dist (T.b.xyz, T.e.xyz);
+ d = proj_xyz_dist (co.xyz, ce.xyz);
if (d > T.tolerance)
return expect_message (d, args);
diff --git a/src/pj_fwd.c b/src/pj_fwd.c
index dbb7748e..d238fa4d 100644
--- a/src/pj_fwd.c
+++ b/src/pj_fwd.c
@@ -79,7 +79,7 @@ static PJ_COORD pj_fwd_prepare (PJ *P, PJ_COORD coo) {
if (coo.lp.lam==HUGE_VAL)
return coo;
if (P->vgridshift)
- coo = proj_trans (P->vgridshift, PJ_FWD, coo);
+ coo = proj_trans (P->vgridshift, PJ_FWD, coo); /* Go orthometric from geometric */
/* Distance from central meridian, taking system zero meridian into account */
coo.lp.lam = (coo.lp.lam - P->from_greenwich) - P->lam0;
@@ -141,7 +141,7 @@ static PJ_COORD pj_fwd_finalize (PJ *P, PJ_COORD coo) {
coo.lpz.lam = adjlon(coo.lpz.lam);
if (P->vgridshift)
- coo = proj_trans (P->vgridshift, PJ_INV, coo);
+ coo = proj_trans (P->vgridshift, PJ_FWD, coo); /* Go orthometric from geometric */
if (coo.lp.lam==HUGE_VAL)
return coo;
if (P->hgridshift)
diff --git a/src/pj_inv.c b/src/pj_inv.c
index 7b47f5d7..4ea88b69 100644
--- a/src/pj_inv.c
+++ b/src/pj_inv.c
@@ -86,7 +86,7 @@ static PJ_COORD pj_inv_prepare (PJ *P, PJ_COORD coo) {
if (coo.lp.lam==HUGE_VAL)
return coo;
if (P->vgridshift)
- coo = proj_trans (P->vgridshift, PJ_FWD, coo);
+ coo = proj_trans (P->vgridshift, PJ_INV, coo); /* Go geometric from orthometric */
return coo;
}
@@ -149,7 +149,7 @@ static PJ_COORD pj_inv_finalize (PJ *P, PJ_COORD coo) {
coo.lpz.lam = adjlon(coo.lpz.lam);
if (P->vgridshift)
- coo = proj_trans (P->vgridshift, PJ_FWD, coo);
+ coo = proj_trans (P->vgridshift, PJ_INV, coo); /* Go geometric from orthometric */
if (coo.lp.lam==HUGE_VAL)
return coo;
if (P->hgridshift)