diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-08-20 23:06:33 +0200 |
|---|---|---|
| committer | Kristian Evers <kristianevers@gmail.com> | 2020-08-21 08:45:47 +0200 |
| commit | b104bc7afbf08a5d2e6097276784424d091b3f59 (patch) | |
| tree | d38f41e1c5c4d95581c70f1df256b85ab2bd0f24 | |
| parent | bc1dcf2cd581a5c144a9c35028bd33aa9191882f (diff) | |
| download | PROJ-b104bc7afbf08a5d2e6097276784424d091b3f59.tar.gz PROJ-b104bc7afbf08a5d2e6097276784424d091b3f59.zip | |
Helmert: fix regression when rotation terms are 0, but scale is not
Fixes #2333
Was due to 3dc92ad7014e1cf20a3bc95c8c21a34a371fcb78
Doesn't affect released versions
| -rw-r--r-- | src/transformations/helmert.cpp | 8 | ||||
| -rw-r--r-- | test/gie/more_builtins.gie | 13 |
2 files changed, 15 insertions, 6 deletions
diff --git a/src/transformations/helmert.cpp b/src/transformations/helmert.cpp index 9fb568a8..d3857d89 100644 --- a/src/transformations/helmert.cpp +++ b/src/transformations/helmert.cpp @@ -373,7 +373,7 @@ static PJ_XYZ helmert_forward_3d (PJ_LPZ lpz, PJ *P) { return point.xyz; } - if (Q->no_rotation) { + if (Q->no_rotation && Q->scale == 0) { point.xyz.x = lpz.lam + Q->xyz.x; point.xyz.y = lpz.phi + Q->xyz.y; point.xyz.z = lpz.z + Q->xyz.z; @@ -413,7 +413,7 @@ static PJ_LPZ helmert_reverse_3d (PJ_XYZ xyz, PJ *P) { return point.lpz; } - if (Q->no_rotation) { + if (Q->no_rotation && Q->scale == 0) { point.xyz.x = xyz.x - Q->xyz.x; point.xyz.y = xyz.y - Q->xyz.y; point.xyz.z = xyz.z - Q->xyz.z; @@ -678,10 +678,6 @@ PJ *TRANSFORMATION(helmert, 0) { proj_log_trace(P, "ds= %8.5f t_epoch=%8.5f", Q->dscale, Q->t_epoch); } - if (Q->no_rotation) { - return P; - } - update_parameters(P); build_rot_matrix(P); diff --git a/test/gie/more_builtins.gie b/test/gie/more_builtins.gie index b9a92e58..41d0ac52 100644 --- a/test/gie/more_builtins.gie +++ b/test/gie/more_builtins.gie @@ -417,6 +417,19 @@ expect 3370658.18087 711877.42750 5349787.12648 2018.0 ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- +# Test case of https://github.com/OSGeo/PROJ/issues/2333 +------------------------------------------------------------------------------- +operation +proj=helmert +x=-0.0019 +y=-0.0017 +z=-0.0105 +s=0.00134 \ + +dx=0.0001 +dy=0.0001 +dz=-0.0018 +ds=0.00008 +t_epoch=2000.0 \ + +convention=position_vector +------------------------------------------------------------------------------- +tolerance 0.1 mm +accept 3513638.1938 778956.4525 5248216.4690 2008.75 +expect 3513638.1999 778956.4533 5248216.4535 2008.75 +------------------------------------------------------------------------------- + + +------------------------------------------------------------------------------- # Test error cases of helmert ------------------------------------------------------------------------------- # A rotational term implies an explicit convention to be specified |
