MCPcopy Create free account
hub / github.com/OSGeo/PROJ / pj_hgridshift_forward_4d

Function pj_hgridshift_forward_4d

src/transformations/hgridshift.cpp:77–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

75}
76
77static void pj_hgridshift_forward_4d(PJ_COORD &coo, PJ *P) {
78 struct hgridshiftData *Q = (struct hgridshiftData *)P->opaque;
79
80 /* If transformation is not time restricted, we always call it */
81 if (Q->t_final == 0 || Q->t_epoch == 0) {
82 // Assigning in 2 steps avoids cppcheck warning
83 // "Overlapping read/write of union is undefined behavior"
84 // Cf
85 // https://github.com/OSGeo/PROJ/pull/3527#pullrequestreview-1233332710
86 const auto xyz = pj_hgridshift_forward_3d(coo.lpz, P);
87 coo.xyz = xyz;
88 return;
89 }
90
91 /* Time restricted - only apply transform if within time bracket */
92 if (coo.lpzt.t < Q->t_epoch && Q->t_final > Q->t_epoch) {
93 // Assigning in 2 steps avoids cppcheck warning
94 // "Overlapping read/write of union is undefined behavior"
95 // Cf
96 // https://github.com/OSGeo/PROJ/pull/3527#pullrequestreview-1233332710
97 const auto xyz = pj_hgridshift_forward_3d(coo.lpz, P);
98 coo.xyz = xyz;
99 }
100}
101
102static void pj_hgridshift_reverse_4d(PJ_COORD &coo, PJ *P) {
103 struct hgridshiftData *Q = (struct hgridshiftData *)P->opaque;

Callers

nothing calls this directly

Calls 1

pj_hgridshift_forward_3dFunction · 0.85

Tested by

no test coverage detected