MCPcopy Create free account
hub / github.com/Kitware/VTK / reverse_3d

Function reverse_3d

ThirdParty/libproj/vtklibproj/src/transformations/hgridshift.cpp:51–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49
50
51static PJ_LPZ reverse_3d(PJ_XYZ xyz, PJ *P) {
52 auto Q = static_cast<hgridshiftData*>(P->opaque);
53 PJ_COORD point = {{0,0,0,0}};
54 point.xyz = xyz;
55
56 if ( Q->defer_grid_opening ) {
57 Q->defer_grid_opening = false;
58 Q->grids = pj_hgrid_init(P, "grids");
59 if ( proj_errno(P) ) {
60 return proj_coord_error().lpz;
61 }
62 }
63
64 if (!Q->grids.empty()) {
65 /* Only try the gridshift if at least one grid is loaded,
66 * otherwise just pass the coordinate through unchanged. */
67 point.lp = pj_hgrid_apply(P->ctx, Q->grids, point.lp, PJ_INV);
68 }
69
70 return point.lpz;
71}
72
73static PJ_COORD forward_4d(PJ_COORD obs, PJ *P) {
74 struct hgridshiftData *Q = (struct hgridshiftData *) P->opaque;

Callers 1

reverse_4dFunction · 0.70

Calls 5

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

Tested by

no test coverage detected