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