From cf6b060f5c3a96afc11e54e52ef2bfe0bab27991 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 21 Mar 2018 03:45:39 +0100 Subject: Take into account +towgs84=0,0,0 in pipeline to still imply geodetic->cartesian->geodetic (fixes #881) --- src/pj_inv.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/pj_inv.c') diff --git a/src/pj_inv.c b/src/pj_inv.c index 4c2266fb..f66fd7d1 100644 --- a/src/pj_inv.c +++ b/src/pj_inv.c @@ -78,9 +78,10 @@ static PJ_COORD inv_prepare (PJ *P, PJ_COORD coo) { if (P->hgridshift) coo = proj_trans (P->hgridshift, PJ_FWD, coo); - else if (P->helmert) { + else if (P->helmert || (P->cart_wgs84 != 0 && P->cart != 0)) { coo = proj_trans (P->cart, PJ_FWD, coo); /* Go cartesian in local frame */ - coo = proj_trans (P->helmert, PJ_FWD, coo); /* Step into WGS84 */ + if( P->helmert ) + coo = proj_trans (P->helmert, PJ_FWD, coo); /* Step into WGS84 */ coo = proj_trans (P->cart_wgs84, PJ_INV, coo); /* Go back to angular using WGS84 ellps */ } if (coo.lp.lam==HUGE_VAL) @@ -154,9 +155,10 @@ static PJ_COORD inv_finalize (PJ *P, PJ_COORD coo) { return coo; if (P->hgridshift) coo = proj_trans (P->hgridshift, PJ_FWD, coo); - else if (P->helmert) { + else if (P->helmert || (P->cart_wgs84 != 0 && P->cart != 0)) { coo = proj_trans (P->cart, PJ_FWD, coo); /* Go cartesian in local frame */ - coo = proj_trans (P->helmert, PJ_FWD, coo); /* Step into WGS84 */ + if( P->helmert ) + coo = proj_trans (P->helmert, PJ_FWD, coo); /* Step into WGS84 */ coo = proj_trans (P->cart_wgs84, PJ_INV, coo); /* Go back to angular using WGS84 ellps */ } if (coo.lp.lam==HUGE_VAL) -- cgit v1.2.3