diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2018-12-28 21:23:33 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2018-12-28 21:23:33 +0100 |
| commit | 5e9d90be141f07eb6b9d041fc0591fd98fa5ce8d (patch) | |
| tree | b38479bf5eb2bd839b3e96b179a1e21bbcbe85cf | |
| parent | 18e63a90b187bcf6421694ed95e90923516c5fef (diff) | |
| download | PROJ-5e9d90be141f07eb6b9d041fc0591fd98fa5ce8d.tar.gz PROJ-5e9d90be141f07eb6b9d041fc0591fd98fa5ce8d.zip | |
ISO19111: fix export to PROJ string of vgridshift to explictly use multiplier=1
| -rw-r--r-- | src/iso19111/coordinateoperation.cpp | 2 | ||||
| -rw-r--r-- | test/unit/test_io.cpp | 3 | ||||
| -rw-r--r-- | test/unit/test_operation.cpp | 18 |
3 files changed, 13 insertions, 10 deletions
diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp index 7e478822..b0d26cc0 100644 --- a/src/iso19111/coordinateoperation.cpp +++ b/src/iso19111/coordinateoperation.cpp @@ -8540,6 +8540,7 @@ void Transformation::_exportToPROJString( } formatter->addStep("vgridshift"); formatter->addParam("grids", heightFilename); + formatter->addParam("multiplier", 1.0); if (isMethodInverseOf) { formatter->stopInversion(); } @@ -8558,6 +8559,7 @@ void Transformation::_exportToPROJString( } formatter->addStep("vgridshift"); formatter->addParam("grids", filename); + formatter->addParam("multiplier", 1.0); if (isMethodInverseOf) { formatter->stopInversion(); } diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp index a029a886..75f208a5 100644 --- a/test/unit/test_io.cpp +++ b/test/unit/test_io.cpp @@ -8060,8 +8060,7 @@ TEST(io, projparse_init) { { auto obj = createFromUserInput( "proj=pipeline step init=epsg:4326 step proj=longlat ellps=WGS84", - dbContext, - true); + dbContext, true); auto co = nn_dynamic_pointer_cast<CoordinateOperation>(obj); ASSERT_TRUE(co != nullptr); EXPECT_EQ(co->exportToPROJString(PROJStringFormatter::create().get()), diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp index 0c127afa..a26574fb 100644 --- a/test/unit/test_operation.cpp +++ b/test/unit/test_operation.cpp @@ -4495,7 +4495,7 @@ TEST(operation, vertCRS_to_geogCRS_context) { PROJStringFormatter::Convention::PROJ_5, authFactory->databaseContext()) .get()), - "+proj=vgridshift +grids=egm08_25.gtx"); + "+proj=vgridshift +grids=egm08_25.gtx +multiplier=1"); } { auto ctxt = @@ -4508,7 +4508,7 @@ TEST(operation, vertCRS_to_geogCRS_context) { ASSERT_EQ(list.size(), 2); EXPECT_EQ( list[0]->exportToPROJString(PROJStringFormatter::create().get()), - "+proj=vgridshift +grids=egm08_25.gtx"); + "+proj=vgridshift +grids=egm08_25.gtx +multiplier=1"); } { auto ctxt = @@ -4521,7 +4521,8 @@ TEST(operation, vertCRS_to_geogCRS_context) { ASSERT_EQ(list.size(), 2); EXPECT_EQ( list[0]->exportToPROJString(PROJStringFormatter::create().get()), - "+proj=pipeline +step +inv +proj=vgridshift +grids=egm08_25.gtx"); + "+proj=pipeline +step +inv +proj=vgridshift +grids=egm08_25.gtx " + "+multiplier=1"); } } @@ -5700,7 +5701,7 @@ static BoundCRSNNPtr createBoundVerticalCRS() { TEST(operation, transformation_height_to_PROJ_string) { auto transf = createBoundVerticalCRS()->transformation(); EXPECT_EQ(transf->exportToPROJString(PROJStringFormatter::create().get()), - "+proj=vgridshift +grids=egm08_25.gtx"); + "+proj=vgridshift +grids=egm08_25.gtx +multiplier=1"); auto grids = transf->gridsNeeded(DatabaseContext::create()); ASSERT_EQ(grids.size(), 1); @@ -5889,8 +5890,8 @@ TEST(operation, compoundCRS_with_boundVerticalCRS_to_geogCRS) { EXPECT_EQ(op->exportToPROJString(PROJStringFormatter::create().get()), "+proj=pipeline +step +proj=axisswap +order=2,1 +step " "+proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=vgridshift " - "+grids=egm08_25.gtx +step +proj=unitconvert +xy_in=rad " - "+xy_out=deg +step +proj=axisswap +order=2,1"); + "+grids=egm08_25.gtx +multiplier=1 +step +proj=unitconvert " + "+xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1"); } // --------------------------------------------------------------------------- @@ -5939,7 +5940,8 @@ TEST(operation, compoundCRS_with_boundGeogCRS_and_boundVerticalCRS_to_geogCRS) { "+proj=longlat +ellps=clrk80ign +pm=paris +step +proj=cart " "+ellps=clrk80ign +step +proj=helmert +x=1 +y=2 +z=3 +rx=4 +ry=5 " "+rz=6 +s=7 +convention=position_vector +step +inv +proj=cart " - "+ellps=WGS84 +step +proj=vgridshift +grids=egm08_25.gtx +step " + "+ellps=WGS84 +step +proj=vgridshift +grids=egm08_25.gtx " + "+multiplier=1 +step " "+proj=unitconvert +xy_in=rad +xy_out=deg +step " "+proj=axisswap +order=2,1"); @@ -5975,7 +5977,7 @@ TEST(operation, compoundCRS_with_boundProjCRS_and_boundVerticalCRS_to_geogCRS) { "+pm=paris +step +proj=cart +ellps=clrk80ign +step +proj=helmert " "+x=1 +y=2 +z=3 +rx=4 +ry=5 +rz=6 +s=7 " "+convention=position_vector +step +inv +proj=cart +ellps=WGS84 " - "+step +proj=vgridshift +grids=egm08_25.gtx +step " + "+step +proj=vgridshift +grids=egm08_25.gtx +multiplier=1 +step " "+proj=unitconvert +xy_in=rad +xy_out=deg +step " "+proj=axisswap +order=2,1"); |
