| 79 | } |
| 80 | |
| 81 | static 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 | |
| 107 | static void pj_vgridshift_forward_4d(PJ_COORD &coo, PJ *P) { |
| 108 | struct vgridshiftData *Q = (struct vgridshiftData *)P->opaque; |
no test coverage detected