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

Function pj_vgridshift_forward_3d

src/transformations/vgridshift.cpp:55–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55static PJ_XYZ pj_vgridshift_forward_3d(PJ_LPZ lpz, PJ *P) {
56 struct vgridshiftData *Q = (struct vgridshiftData *)P->opaque;
57 PJ_COORD point = {{0, 0, 0, 0}};
58 point.lpz = lpz;
59
60 if (Q->defer_grid_opening) {
61 Q->defer_grid_opening = false;
62 Q->grids = pj_vgrid_init(P, "grids");
63 deal_with_vertcon_gtx_hack(P);
64 Q->error_code_in_defer_grid_opening = proj_errno(P);
65 }
66 if (Q->error_code_in_defer_grid_opening) {
67 proj_errno_set(P, Q->error_code_in_defer_grid_opening);
68 return proj_coord_error().xyz;
69 }
70
71 if (!Q->grids.empty()) {
72 /* Only try the gridshift if at least one grid is loaded,
73 * otherwise just pass the coordinate through unchanged. */
74 point.xyz.z +=
75 pj_vgrid_value(P, Q->grids, point.lp, Q->forward_multiplier);
76 }
77
78 return point.xyz;
79}
80
81static PJ_LPZ pj_vgridshift_reverse_3d(PJ_XYZ xyz, PJ *P) {
82 struct vgridshiftData *Q = (struct vgridshiftData *)P->opaque;

Callers 1

pj_vgridshift_forward_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