diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2018-04-07 15:35:08 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2018-04-07 16:38:26 +0200 |
| commit | ac78787bf3bfa15dabbbad0042ca762020542365 (patch) | |
| tree | aaf7b2a09416901f991c3b853817d281e31f635a /src | |
| parent | 5f0e22ecec2ed479d37b5a3a3d861d56a1a0557b (diff) | |
| download | PROJ-ac78787bf3bfa15dabbbad0042ca762020542365.tar.gz PROJ-ac78787bf3bfa15dabbbad0042ca762020542365.zip | |
Pipeline: make sure geocentric/cartesian space transform is done with original ellipsoid parameters (before any projection mess with them)
Diffstat (limited to 'src')
| -rw-r--r-- | src/PJ_pipeline.c | 2 | ||||
| -rw-r--r-- | src/proj_4D_api.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/PJ_pipeline.c b/src/PJ_pipeline.c index b60e05a8..aa7d76f8 100644 --- a/src/PJ_pipeline.c +++ b/src/PJ_pipeline.c @@ -306,6 +306,8 @@ static void set_ellipsoid(PJ *P) { /* the PJ you provided". */ proj_errno_reset (P); } + P->a_orig = P->a; + P->es_orig = P->es; pj_calc_ellipsoid_params (P, P->a, P->es); diff --git a/src/proj_4D_api.c b/src/proj_4D_api.c index 11a56ac0..aed4685b 100644 --- a/src/proj_4D_api.c +++ b/src/proj_4D_api.c @@ -485,7 +485,7 @@ Returns 1 on success, 0 on failure if (0==d[0] && 0==d[1] && 0==d[2] && 0==d[3] && 0==d[4] && 0==d[5] && 0==d[6]) { /* If the current ellipsoid is not WGS84, then make sure the */ /* change in ellipsoid is still done. */ - if (!(fabs(P->a - 6378137.0) < 1e-8 && fabs(P->f - 1./ 298.257223563) < 1e-15)) { + if (!(fabs(P->a_orig - 6378137.0) < 1e-8 && fabs(P->es_orig - 0.0066943799901413) < 1e-15)) { do_cart = 1; } break; @@ -512,7 +512,7 @@ Returns 1 on success, 0 on failure /* geocentric/cartesian space or we need to do a Helmert transform. */ if (P->is_geocent || P->helmert || do_cart) { char def[150]; - sprintf (def, "break_cs2cs_recursion proj=cart a=%40.20g f=%40.20g", P->a, P->f); + sprintf (def, "break_cs2cs_recursion proj=cart a=%40.20g es=%40.20g", P->a_orig, P->es_orig); Q = proj_create (P->ctx, def); if (0==Q) return 0; |
