diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2018-01-23 20:40:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-01-23 20:40:36 +0100 |
| commit | 29cb4a05153ec8dd13857b6b9329fa2a6c067840 (patch) | |
| tree | 321868fb1aca3d0e032219408986afa50cb6bac1 | |
| parent | 33a7216aea7bacf8cff72a5e6bb59b25e7d931f7 (diff) | |
| parent | d0dbf48438f9e152314abf294467cb54f9ae0e70 (diff) | |
| download | PROJ-29cb4a05153ec8dd13857b6b9329fa2a6c067840.tar.gz PROJ-29cb4a05153ec8dd13857b6b9329fa2a6c067840.zip | |
Merge pull request #743 from kbevers/fix-nullgrid-datumtransform
Handle ellipsoid parameters correctly when using +nadgrids=@null.
| -rw-r--r-- | nad/proj_outIGNF.dist | 10 | ||||
| -rw-r--r-- | src/pj_transform.c | 21 |
2 files changed, 22 insertions, 9 deletions
diff --git a/nad/proj_outIGNF.dist b/nad/proj_outIGNF.dist index 45112f60..be666fb0 100644 --- a/nad/proj_outIGNF.dist +++ b/nad/proj_outIGNF.dist @@ -1,16 +1,16 @@ +init=./IGNF:NTFG +to +init=./IGNF:RGF93G 3.300866856 43.4477976569 0.0000 3d18'0.915"E 43d26'52.077"N 0.000 +init=./IGNF:LAMBE +to +init=./IGNF:LAMB93 - 600000.0000 2600545.4523 0.0000 652760.737 7033791.243 0.000 + 600000.0000 2600545.4523 0.0000 652760.737 7033791.244 0.000 135638.3592 2418760.4094 0.0000 187194.062 6855928.882 0.000 998137.3947 2413822.2844 0.0000 1049052.258 6843776.562 0.000 - 600000.0000 2200000.0000 0.0000 649398.872 6633524.191 0.000 + 600000.0000 2200000.0000 0.0000 649398.872 6633524.192 0.000 311552.5340 1906457.4840 0.0000 358799.172 6342652.486 0.000 960488.4138 1910172.8812 0.0000 1007068.686 6340907.237 0.000 600000.0000 1699510.8340 0.0000 645204.279 6133556.746 0.000 -1203792.5981 626873.17210 0.0000 1238875.764 5057405.016 0.000 +1203792.5981 626873.17210 0.0000 1238875.764 5057405.017 0.000 +init=./IGNF:LAMBE +to +init=./IGNF:GEOPORTALFXX - 600000.0000 2600545.4523 0.0000 179040.148 5610495.275 0.000 + 600000.0000 2600545.4523 0.0000 179040.148 5610495.276 0.000 135638.3592 2418760.4094 0.0000 -303729.363 5410118.356 0.000 998137.3947 2413822.2844 0.0000 592842.792 5410120.554 0.000 600000.0000 2200000.0000 0.0000 179041.670 5209746.080 0.000 @@ -37,4 +37,4 @@ 2d20'11.7754730" 42d18'00.0824436" 0.0 260109.601 5009175.714 0.000 9d32'12.6680218" 41d24'00.3542556" 0.0 1061637.534 4889066.592 0.000 +init=./IGNF:RGR92 +to +init=./IGNF:REUN47 -3356123.5400 1303218.3090 5247430.6050 3353421.833 1304074.314 5248935.607 +3356123.5400 1303218.3090 5247430.6050 3353421.833 1304074.314 5248935.606 diff --git a/src/pj_transform.c b/src/pj_transform.c index c72df2e7..6ad227cd 100644 --- a/src/pj_transform.c +++ b/src/pj_transform.c @@ -748,17 +748,30 @@ int pj_datum_transform( PJ *srcdefn, PJ *dstdefn, /* -------------------------------------------------------------------- */ if( srcdefn->datum_type == PJD_GRIDSHIFT ) { + const char* srcnadgrids = pj_param(srcdefn->ctx, srcdefn->params,"snadgrids").s; + pj_apply_gridshift_2( srcdefn, 0, point_count, point_offset, x, y, z ); CHECK_RETURN(srcdefn); - src_a = SRS_WGS84_SEMIMAJOR; - src_es = SRS_WGS84_ESQUARED; + /* If the gridlist has either "@null" or "null" as its only */ + /* grid we don't change the ellipsoid parameters, since the */ + /* datum shift to WGS84 was not performed in practice. */ + if ( strcmp("@null", srcnadgrids) && strcmp("null", srcnadgrids) ) { + src_a = SRS_WGS84_SEMIMAJOR; + src_es = SRS_WGS84_ESQUARED; + } } if( dstdefn->datum_type == PJD_GRIDSHIFT ) { - dst_a = SRS_WGS84_SEMIMAJOR; - dst_es = SRS_WGS84_ESQUARED; + const char* dstnadgrids = pj_param(dstdefn->ctx, dstdefn->params,"snadgrids").s; + /* If the gridlist has either "@null" or "null" as its only */ + /* grid we don't change the ellipsoid parameters, since the */ + /* datum shift to WGS84 will not be performed. */ + if ( strcmp("@null", dstnadgrids) && strcmp("null", dstnadgrids) ) { + dst_a = SRS_WGS84_SEMIMAJOR; + dst_es = SRS_WGS84_ESQUARED; + } } /* ==================================================================== */ |
