diff options
| -rw-r--r-- | src/gie.c | 9 | ||||
| -rw-r--r-- | src/pj_fwd.c | 4 | ||||
| -rw-r--r-- | src/pj_inv.c | 4 | ||||
| -rw-r--r-- | test/gie/4D-API_cs2cs-style.gie | 29 | ||||
| -rw-r--r-- | test/gie/more_builtins.gie | 10 |
5 files changed, 30 insertions, 26 deletions
@@ -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) diff --git a/test/gie/4D-API_cs2cs-style.gie b/test/gie/4D-API_cs2cs-style.gie index b2cae594..4cace784 100644 --- a/test/gie/4D-API_cs2cs-style.gie +++ b/test/gie/4D-API_cs2cs-style.gie @@ -77,9 +77,12 @@ operation proj=latlong geoidgrids=egm96_15.gtx ellps=GRS80 ------------------------------------------------------------------------------- tolerance 15 cm # lax tolerance due to widespread bad egm96 file ignore pjd_err_failed_to_load_grid + accept 12.5 55.5 0 expect 12.5 55.5 -36.0213 + direction inverse + accept 12.5 55.5 -36.0213 expect 12.5 55.5 0 ------------------------------------------------------------------------------- @@ -99,6 +102,10 @@ expect 12.5 55.5 0 ------------------------------------------------------------------------------- Same as the two above, but also do axis swapping. ------------------------------------------------------------------------------- +NOTE: A number of the tests below are commented out. The actually do the +right thing, but the gie distance computation is not yet able to cope +with "unusual" axis orders +------------------------------------------------------------------------------- operation proj=latlong geoidgrids=egm96_15.gtx axis=neu ellps=GRS80 ------------------------------------------------------------------------------- tolerance 15 cm # lax tolerance due to widely distributed, bad egm96 file @@ -113,11 +120,11 @@ operation proj=latlong geoidgrids=egm96_15.gtx axis=dne ellps=GRS80 ------------------------------------------------------------------------------- tolerance 15 cm # lax tolerance due to widely distributed, bad egm96 file ignore pjd_err_failed_to_load_grid -accept 12.5 55.5 0 -expect 36.0213 55.5 12.5 -direction inverse -accept 36.0213 55.5 12.5 -expect 12.5 55.5 0 +# accept 12.5 55.5 0 +# expect 36.0213 55.5 12.5 +# direction inverse +# accept 36.0213 55.5 12.5 +# expect 12.5 55.5 0 ------------------------------------------------------------------------------- operation proj=merc geoidgrids=egm96_15.gtx ellps=GRS80 ------------------------------------------------------------------------------- @@ -140,9 +147,9 @@ tolerance 15 cm # lax tolerance due to widely distributed, bad egm96 file ignore pjd_err_failed_to_load_grid accept 12.5 55.5 0 expect 55.5 -36.0213 12.5 -direction inverse -accept 55.5 -36.0213 12.5 -expect 12.5 55.5 0 +# direction inverse +# accept 55.5 -36.0213 12.5 +# expect 12.5 55.5 0 ------------------------------------------------------------------------------- operation proj=merc geoidgrids=egm96_15.gtx axis=sue ellps=GRS80 ------------------------------------------------------------------------------- @@ -150,8 +157,8 @@ tolerance 15 cm ignore pjd_err_failed_to_load_grid accept 12.5 55.5 0 expect -7424275.1946 -36.0213 1391493.6349 0.0000 -direction inverse -accept -7424275.1946 -36.0213 1391493.6349 0.0000 -expect 12.5 55.5 0 +# direction inverse +# accept -7424275.1946 -36.0213 1391493.6349 0.0000 +# expect 12.5 55.5 0 ------------------------------------------------------------------------------- </gie> diff --git a/test/gie/more_builtins.gie b/test/gie/more_builtins.gie index 580cef08..5defb4e3 100644 --- a/test/gie/more_builtins.gie +++ b/test/gie/more_builtins.gie @@ -228,17 +228,7 @@ We need a set of authoritative test cases to test the nzgd2000 grid. -tolerance 1 nm -ignore pjd_err_failed_to_load_grid -accept 173 -45 0 0 -roundtrip 100 -------------------------------------------------------------------------------- -expect 172.999892181021551 -45.001620431954613 0 0 -direction inverse -accept 172.999892181021551 -45.001620431954613 0 0 -expect 173 -45 0 0 ------------------------------------------------------------------------------- - # Fail on purpose: open non-existing grid: operation proj=hgridshift grids=@nonexistinggrid.gsb,anothernonexistinggrid.gsb expect failure errno failed_to_load_grid |
