diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-12-05 01:03:46 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-12-06 21:35:14 +0100 |
| commit | 6875ef7116b9dab4021afeb06e2b79cd5679743b (patch) | |
| tree | 8863c3547cb75456c818c835e0bc016a6bc0cbe1 /src/transform.cpp | |
| parent | 126384854bf8e1b7461aebcc28966a6559971de1 (diff) | |
| download | PROJ-6875ef7116b9dab4021afeb06e2b79cd5679743b.tar.gz PROJ-6875ef7116b9dab4021afeb06e2b79cd5679743b.zip | |
horizontal grid shift: rework to no longer load whole grid into memory
Diffstat (limited to 'src/transform.cpp')
| -rw-r--r-- | src/transform.cpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/src/transform.cpp b/src/transform.cpp index 863da605..f6002b70 100644 --- a/src/transform.cpp +++ b/src/transform.cpp @@ -867,6 +867,58 @@ int pj_geocentric_from_wgs84( PJ *defn, return 0; } + +/************************************************************************/ +/* pj_apply_gridshift_2() */ +/* */ +/* This implementation uses the gridlist from a coordinate */ +/* system definition. If the gridlist has not yet been */ +/* populated in the coordinate system definition we set it up */ +/* now. */ +/************************************************************************/ +static +int pj_apply_gridshift_2( PJ *defn, int inverse, + long point_count, int point_offset, + double *x, double *y, double * /*z*/ ) + +{ + if( defn->hgrids.empty() ) + { + proj_hgrid_init(defn, "nadgrids"); + } + + for( long i = 0; i < point_count; i++ ) + { + PJ_LP input; + + long io = i * point_offset; + input.phi = y[io]; + input.lam = x[io]; + + auto output = proj_hgrid_apply(defn, input, inverse ? PJ_INV : PJ_FWD); + + if ( output.lam != HUGE_VAL ) + { + y[io] = output.phi; + x[io] = output.lam; + } + else + { + if( defn->ctx->debug_level >= PJ_LOG_DEBUG_MAJOR ) + { + pj_log( defn->ctx, PJ_LOG_DEBUG_MAJOR, + "pj_apply_gridshift(): failed to find a grid shift table for\n" + " location (%.7fdW,%.7fdN)", + x[io] * RAD_TO_DEG, + y[io] * RAD_TO_DEG ); + } + } + } + + return 0; +} + + /************************************************************************/ /* pj_datum_transform() */ /* */ @@ -1107,3 +1159,8 @@ static int adjust_axis( projCtx ctx, return 0; } +// --------------------------------------------------------------------------- + +void pj_deallocate_grids() +{ +} |
