diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2019-01-22 19:47:18 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-22 19:47:18 +0100 |
| commit | f0197a532b9ed0facafa0be135c208d5b570ac57 (patch) | |
| tree | 5ba1c8d7aefbbfc40a80834d6ba5a772e9bc04b3 /test/unit/test_operation.cpp | |
| parent | 8ff49e280c446421ca4669e851687847b0da7c9a (diff) | |
| parent | 7e11edaa2d1abc09478f3bd3fb9926cb0ef3fdda (diff) | |
| download | PROJ-f0197a532b9ed0facafa0be135c208d5b570ac57.tar.gz PROJ-f0197a532b9ed0facafa0be135c208d5b570ac57.zip | |
Merge pull request #1233 from rouault/fix_1232
Coordinate operation computation with boundcrs / wktext: drop useless early bindins terms in generated pipeline (fixes #1232)
Diffstat (limited to 'test/unit/test_operation.cpp')
| -rw-r--r-- | test/unit/test_operation.cpp | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp index d134f086..6c1ecf1c 100644 --- a/test/unit/test_operation.cpp +++ b/test/unit/test_operation.cpp @@ -6303,7 +6303,7 @@ TEST(operation, createOperation_on_crs_with_canonical_bound_crs) { TEST(operation, createOperation_fallback_to_proj4_strings) { auto objDest = PROJStringParser().createFromPROJString( - "+proj=longlat +geoc +ellps=WGS84 +type=crs"); + "+proj=longlat +geoc +datum=WGS84 +type=crs"); auto dest = nn_dynamic_pointer_cast<GeographicCRS>(objDest); ASSERT_TRUE(dest != nullptr); @@ -6313,13 +6313,38 @@ TEST(operation, createOperation_fallback_to_proj4_strings) { 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 +inv +proj=longlat +datum=WGS84 " "+step +proj=longlat +geoc +ellps=WGS84 " "+step +proj=unitconvert +xy_in=rad +xy_out=deg"); } // --------------------------------------------------------------------------- +TEST(operation, createOperation_on_crs_with_bound_crs_and_wktext) { + auto objSrc = PROJStringParser().createFromPROJString( + "+proj=utm +zone=55 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 " + "+units=m +no_defs +nadgrids=@GDA94_GDA2020_conformal.gsb +ignored1 " + "+ignored2=val +wktext +type=crs"); + auto src = nn_dynamic_pointer_cast<CRS>(objSrc); + ASSERT_TRUE(src != nullptr); + + auto objDst = PROJStringParser().createFromPROJString( + "+proj=utm +zone=55 +south +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 " + "+units=m +no_defs +type=crs"); + auto dst = nn_dynamic_pointer_cast<CRS>(objDst); + ASSERT_TRUE(dst != nullptr); + + auto op = CoordinateOperationFactory::create()->createOperation( + NN_CHECK_ASSERT(src), NN_CHECK_ASSERT(dst)); + ASSERT_TRUE(op != nullptr); + EXPECT_EQ(op->exportToPROJString(PROJStringFormatter::create().get()), + "+proj=pipeline +step +inv +proj=utm +zone=55 +south " + "+ellps=GRS80 +step +proj=hgridshift " + "+grids=@GDA94_GDA2020_conformal.gsb +step +proj=utm +zone=55 " + "+south +ellps=GRS80"); +} + +// --------------------------------------------------------------------------- + TEST(operation, mercator_variant_A_to_variant_B) { auto projCRS = ProjectedCRS::create( PropertyMap(), GeographicCRS::EPSG_4326, |
