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

Function pj_hgridshift_forward_3d

src/transformations/hgridshift.cpp:29–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27} // anonymous namespace
28
29static PJ_XYZ pj_hgridshift_forward_3d(PJ_LPZ lpz, PJ *P) {
30 auto Q = static_cast<hgridshiftData *>(P->opaque);
31 PJ_COORD point = {{0, 0, 0, 0}};
32 point.lpz = lpz;
33
34 if (Q->defer_grid_opening) {
35 Q->defer_grid_opening = false;
36 Q->grids = pj_hgrid_init(P, "grids");
37 Q->error_code_in_defer_grid_opening = proj_errno(P);
38 }
39 if (Q->error_code_in_defer_grid_opening) {
40 proj_errno_set(P, Q->error_code_in_defer_grid_opening);
41 return proj_coord_error().xyz;
42 }
43
44 if (!Q->grids.empty()) {
45 /* Only try the gridshift if at least one grid is loaded,
46 * otherwise just pass the coordinate through unchanged. */
47 point.lp = pj_hgrid_apply(P->ctx, Q->grids, point.lp, PJ_FWD);
48 }
49
50 return point.xyz;
51}
52
53static PJ_LPZ pj_hgridshift_reverse_3d(PJ_XYZ xyz, PJ *P) {
54 auto Q = static_cast<hgridshiftData *>(P->opaque);

Callers 1

pj_hgridshift_forward_4dFunction · 0.85

Calls 6

pj_hgrid_initFunction · 0.85
proj_errnoFunction · 0.85
proj_errno_setFunction · 0.85
proj_coord_errorFunction · 0.85
pj_hgrid_applyFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected