aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2018-06-21 23:44:53 +0200
committerEven Rouault <even.rouault@spatialys.com>2018-06-21 23:44:53 +0200
commit275cbbaca08864867e6e3c7bf199a38204d3fffe (patch)
treef3c9e4be7515f3b3e549678d2a7f1a694adeeae6 /src
parent8ee389a6f44fb9ac0380ddbd3706b9354269d62f (diff)
downloadPROJ-275cbbaca08864867e6e3c7bf199a38204d3fffe.tar.gz
PROJ-275cbbaca08864867e6e3c7bf199a38204d3fffe.zip
Make +proj=geocent and +proj=cart take into account +to_meter (relates to #1053)
Diffstat (limited to 'src')
-rw-r--r--src/pj_fwd.c3
-rw-r--r--src/pj_inv.c6
2 files changed, 8 insertions, 1 deletions
diff --git a/src/pj_fwd.c b/src/pj_fwd.c
index b5f1b36e..2ed4c469 100644
--- a/src/pj_fwd.c
+++ b/src/pj_fwd.c
@@ -114,6 +114,9 @@ static PJ_COORD fwd_finalize (PJ *P, PJ_COORD coo) {
if (P->is_geocent) {
coo = proj_trans (P->cart, PJ_FWD, coo);
}
+ coo.xyz.x *= P->fr_meter;
+ coo.xyz.y *= P->fr_meter;
+ coo.xyz.z *= P->fr_meter;
break;
diff --git a/src/pj_inv.c b/src/pj_inv.c
index ca149674..d1a02bca 100644
--- a/src/pj_inv.c
+++ b/src/pj_inv.c
@@ -100,8 +100,12 @@ static PJ_COORD inv_prepare (PJ *P, PJ_COORD coo) {
/* de-scale and de-offset */
case PJ_IO_UNITS_CARTESIAN:
- if (P->is_geocent)
+ coo.xyz.x *= P->to_meter;
+ coo.xyz.y *= P->to_meter;
+ coo.xyz.z *= P->to_meter;
+ if (P->is_geocent) {
coo = proj_trans (P->cart, PJ_INV, coo);
+ }
return coo;