aboutsummaryrefslogtreecommitdiff
path: root/src/transformations
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2019-02-14 12:00:45 +0100
committerKristian Evers <kristianevers@gmail.com>2019-02-14 12:00:45 +0100
commit29a59cadb9d1371479477af517f3431784e880f9 (patch)
tree040806680521072ffdc1e5b68a2c34d82646c857 /src/transformations
parent15a225b0d80281b80c536e7b5dde334d12c406c6 (diff)
downloadPROJ-29a59cadb9d1371479477af517f3431784e880f9.tar.gz
PROJ-29a59cadb9d1371479477af517f3431784e880f9.zip
Reverse direction of deformation operations/transformations/deformation
Changed the direction of dt-calculation to follow the same convention as helmert. Changed from dt = t_c - t_obs to dt = t_obs - t_c, which effectively reverses the direction of the operation. Existing projstrings using deformation can simply reverse the direction of the operation to achieve the same results as before this commit.
Diffstat (limited to 'src/transformations')
-rw-r--r--src/transformations/deformation.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/transformations/deformation.cpp b/src/transformations/deformation.cpp
index 9221d39e..14f34e4e 100644
--- a/src/transformations/deformation.cpp
+++ b/src/transformations/deformation.cpp
@@ -172,7 +172,7 @@ static PJ_XYZ forward_3d(PJ_LPZ lpz, PJ *P) {
out = in;
if (Q->t_obs != HUGE_VAL) {
- dt = Q->t_epoch - Q->t_obs;
+ dt = Q->t_obs - Q->t_epoch;
} else {
out = proj_coord_error(); /* in the 3D case +t_obs must be specified */
proj_log_debug(P, "deformation: +t_obs must be specified");
@@ -196,9 +196,9 @@ static PJ_COORD forward_4d(PJ_COORD in, PJ *P) {
PJ_COORD out = in;
if (Q->t_obs != HUGE_VAL) {
- dt = Q->t_epoch - Q->t_obs;
+ dt = Q->t_obs - Q->t_epoch;
} else {
- dt = Q->t_epoch - in.xyzt.t;
+ dt = in.xyzt.t - Q->t_epoch ;
}
shift = get_grid_shift(P, in.xyz);
@@ -219,7 +219,7 @@ static PJ_LPZ reverse_3d(PJ_XYZ in, PJ *P) {
out.xyz = in;
if (Q->t_obs != HUGE_VAL) {
- dt = Q->t_epoch - Q->t_obs;
+ dt = Q->t_obs - Q->t_epoch;
} else {
out = proj_coord_error(); /* in the 3D case +t_obs must be specified */
proj_log_debug(P, "deformation: +t_obs must be specified");
@@ -238,9 +238,9 @@ static PJ_COORD reverse_4d(PJ_COORD in, PJ *P) {
if (Q->t_obs != HUGE_VAL) {
- dt = Q->t_epoch - Q->t_obs;
+ dt = Q->t_obs - Q->t_epoch;
} else {
- dt = Q->t_epoch - in.xyzt.t;
+ dt = in.xyzt.t - Q->t_epoch;
}
out.xyz = reverse_shift(P, in.xyz, dt);