From 31c6914941ae05a0206647fac232108cab86dbef Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 29 Jun 2018 00:25:42 +0200 Subject: Helmert: consider that xyzt.t == HUGE_VAL means t_epoch Currently when doing echo "2 49 0" | src/cct +proj=pipeline +ellps=GRS80 +step +proj=cart +step +proj=helmert +x=10 +y=3 +z=1 we get as a result: -nan -nan -nan inf This is due to cct initializing the xyzt.t to HUGE_VAL --- src/PJ_helmert.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/PJ_helmert.c b/src/PJ_helmert.c index 8ba955bb..490bc2c4 100644 --- a/src/PJ_helmert.c +++ b/src/PJ_helmert.c @@ -431,8 +431,9 @@ static PJ_COORD helmert_forward_4d (PJ_COORD point, PJ *P) { /* We only need to rebuild the rotation matrix if the * observation time is different from the last call */ - if (point.xyzt.t != Q->t_obs) { - Q->t_obs = point.xyzt.t; + double t_obs = (point.xyzt.t == HUGE_VAL) ? Q->t_epoch : point.xyzt.t; + if (t_obs != Q->t_obs) { + Q->t_obs = t_obs; update_parameters(P); build_rot_matrix(P); } @@ -448,8 +449,9 @@ static PJ_COORD helmert_reverse_4d (PJ_COORD point, PJ *P) { /* We only need to rebuild the rotation matrix if the * observation time is different from the last call */ - if (point.xyzt.t != Q->t_obs) { - Q->t_obs = point.xyzt.t; + double t_obs = (point.xyzt.t == HUGE_VAL) ? Q->t_epoch : point.xyzt.t; + if (t_obs != Q->t_obs) { + Q->t_obs = t_obs; update_parameters(P); build_rot_matrix(P); } -- cgit v1.2.3