diff options
| -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 |
