diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2018-03-21 03:45:39 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2018-03-21 10:51:53 +0100 |
| commit | cf6b060f5c3a96afc11e54e52ef2bfe0bab27991 (patch) | |
| tree | ba6c0ded8a022bd0fdf74483ccb43513762033ae /src/pj_inv.c | |
| parent | 60dc8062e06964fb44532cf353c9f3792d57aa68 (diff) | |
| download | PROJ-cf6b060f5c3a96afc11e54e52ef2bfe0bab27991.tar.gz PROJ-cf6b060f5c3a96afc11e54e52ef2bfe0bab27991.zip | |
Take into account +towgs84=0,0,0 in pipeline to still imply geodetic->cartesian->geodetic (fixes #881)
Diffstat (limited to 'src/pj_inv.c')
| -rw-r--r-- | src/pj_inv.c | 10 |
1 files changed, 6 insertions, 4 deletions
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) |
