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