MCPcopy Create free account
hub / github.com/OSGeo/PROJ / pj_hgrid_apply

Function pj_hgrid_apply

src/grids.cpp:3508–3538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3506// ---------------------------------------------------------------------------
3507
3508PJ_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() */

Callers 2

pj_hgridshift_forward_3dFunction · 0.85
pj_hgridshift_reverse_3dFunction · 0.85

Calls 4

findGridFunction · 0.85
proj_context_errno_setFunction · 0.85
pj_hgrid_apply_internalFunction · 0.85
isNullGridMethod · 0.45

Tested by

no test coverage detected