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

Function pj_vgridshift_forward_4d

src/transformations/vgridshift.cpp:107–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107static void pj_vgridshift_forward_4d(PJ_COORD &coo, PJ *P) {
108 struct vgridshiftData *Q = (struct vgridshiftData *)P->opaque;
109
110 /* If transformation is not time restricted, we always call it */
111 if (Q->t_final == 0 || Q->t_epoch == 0) {
112 // Assigning in 2 steps avoids cppcheck warning
113 // "Overlapping read/write of union is undefined behavior"
114 // Cf
115 // https://github.com/OSGeo/PROJ/pull/3527#pullrequestreview-1233332710
116 const auto xyz = pj_vgridshift_forward_3d(coo.lpz, P);
117 coo.xyz = xyz;
118 return;
119 }
120
121 /* Time restricted - only apply transform if within time bracket */
122 if (coo.lpzt.t < Q->t_epoch && Q->t_final > Q->t_epoch) {
123 // Assigning in 2 steps avoids cppcheck warning
124 // "Overlapping read/write of union is undefined behavior"
125 // Cf
126 // https://github.com/OSGeo/PROJ/pull/3527#pullrequestreview-1233332710
127 const auto xyz = pj_vgridshift_forward_3d(coo.lpz, P);
128 coo.xyz = xyz;
129 }
130}
131
132static void pj_vgridshift_reverse_4d(PJ_COORD &coo, PJ *P) {
133 struct vgridshiftData *Q = (struct vgridshiftData *)P->opaque;

Callers

nothing calls this directly

Calls 1

pj_vgridshift_forward_3dFunction · 0.85

Tested by

no test coverage detected