aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2018-06-29 00:25:42 +0200
committerEven Rouault <even.rouault@spatialys.com>2018-06-29 00:25:42 +0200
commit31c6914941ae05a0206647fac232108cab86dbef (patch)
treea51f3871d4f741c0284a7d6391d9f809cf2163d4
parent50b0855177a0b6ce8053c2cb94b6a0db9d480b03 (diff)
downloadPROJ-31c6914941ae05a0206647fac232108cab86dbef.tar.gz
PROJ-31c6914941ae05a0206647fac232108cab86dbef.zip
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
-rw-r--r--src/PJ_helmert.c10
1 files changed, 6 insertions, 4 deletions
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);
}