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

Function pj_vgridshift_reverse_3d

src/transformations/vgridshift.cpp:81–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81static PJ_LPZ pj_vgridshift_reverse_3d(PJ_XYZ xyz, PJ *P) {
82 struct vgridshiftData *Q = (struct vgridshiftData *)P->opaque;
83 PJ_COORD point = {{0, 0, 0, 0}};
84 point.xyz = xyz;
85
86 if (Q->defer_grid_opening) {
87 Q->defer_grid_opening = false;
88 Q->grids = pj_vgrid_init(P, "grids");
89 deal_with_vertcon_gtx_hack(P);
90 Q->error_code_in_defer_grid_opening = proj_errno(P);
91 }
92 if (Q->error_code_in_defer_grid_opening) {
93 proj_errno_set(P, Q->error_code_in_defer_grid_opening);
94 return proj_coord_error().lpz;
95 }
96
97 if (!Q->grids.empty()) {
98 /* Only try the gridshift if at least one grid is loaded,
99 * otherwise just pass the coordinate through unchanged. */
100 point.xyz.z -=
101 pj_vgrid_value(P, Q->grids, point.lp, Q->forward_multiplier);
102 }
103
104 return point.lpz;
105}
106
107static void pj_vgridshift_forward_4d(PJ_COORD &coo, PJ *P) {
108 struct vgridshiftData *Q = (struct vgridshiftData *)P->opaque;

Callers 1

pj_vgridshift_reverse_4dFunction · 0.85

Calls 7

pj_vgrid_initFunction · 0.85
proj_errnoFunction · 0.85
proj_errno_setFunction · 0.85
proj_coord_errorFunction · 0.85
pj_vgrid_valueFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected