| 3506 | // --------------------------------------------------------------------------- |
| 3507 | |
| 3508 | PJ_LP pj_hgrid_apply(PJ_CONTEXT *ctx, const ListOfHGrids &grids, PJ_LP lp, |
| 3509 | PJ_DIRECTION direction) { |
| 3510 | PJ_LP out; |
| 3511 | |
| 3512 | out.lam = HUGE_VAL; |
| 3513 | out.phi = HUGE_VAL; |
| 3514 | |
| 3515 | while (true) { |
| 3516 | HorizontalShiftGridSet *gridset = nullptr; |
| 3517 | const auto grid = findGrid(grids, lp, gridset); |
| 3518 | if (!grid) { |
| 3519 | proj_context_errno_set(ctx, PROJ_ERR_COORD_TRANSFM_OUTSIDE_GRID); |
| 3520 | return out; |
| 3521 | } |
| 3522 | if (grid->isNullGrid()) { |
| 3523 | return lp; |
| 3524 | } |
| 3525 | |
| 3526 | bool shouldRetry = false; |
| 3527 | out = pj_hgrid_apply_internal(ctx, lp, direction, grid, gridset, grids, |
| 3528 | shouldRetry); |
| 3529 | if (!shouldRetry) { |
| 3530 | break; |
| 3531 | } |
| 3532 | } |
| 3533 | |
| 3534 | if (out.lam == HUGE_VAL || out.phi == HUGE_VAL) |
| 3535 | proj_context_errno_set(ctx, PROJ_ERR_COORD_TRANSFM_OUTSIDE_GRID); |
| 3536 | |
| 3537 | return out; |
| 3538 | } |
| 3539 | |
| 3540 | /********************************************/ |
| 3541 | /* proj_hgrid_value() */ |
no test coverage detected