From c048292f3b8e408e6a81700a74d9b44d532227ac Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 22 Jan 2019 10:58:13 +0100 Subject: Coordinate operation computation with boundcrs / wktext: drop useless early bindins terms in generated pipeline (fixes #1232) --- test/unit/test_operation.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'test/unit/test_operation.cpp') diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp index d134f086..ed31f155 100644 --- a/test/unit/test_operation.cpp +++ b/test/unit/test_operation.cpp @@ -6320,6 +6320,32 @@ TEST(operation, createOperation_fallback_to_proj4_strings) { // --------------------------------------------------------------------------- +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 " + "+type=crs"); + auto src = nn_dynamic_pointer_cast(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(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, -- cgit v1.2.3 From b172b29fa0e1dac18270b41dde81df2759521c16 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 22 Jan 2019 14:36:16 +0100 Subject: ISO19111 PROJ string parser: discard parameters not recognized by PROJ --- test/unit/test_operation.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/unit/test_operation.cpp') diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp index ed31f155..01c6a38f 100644 --- a/test/unit/test_operation.cpp +++ b/test/unit/test_operation.cpp @@ -6323,8 +6323,8 @@ TEST(operation, createOperation_fallback_to_proj4_strings) { 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 " - "+type=crs"); + "+units=m +no_defs +nadgrids=@GDA94_GDA2020_conformal.gsb +ignored1 " + "+ignored2=val +wktext +type=crs"); auto src = nn_dynamic_pointer_cast(objSrc); ASSERT_TRUE(src != nullptr); @@ -6340,7 +6340,7 @@ TEST(operation, createOperation_on_crs_with_bound_crs_and_wktext) { 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 " + "+grids=@GDA94_GDA2020_conformal.gsb +step +proj=utm +zone=55 " "+south +ellps=GRS80"); } -- cgit v1.2.3 From 7e11edaa2d1abc09478f3bd3fb9926cb0ef3fdda Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Tue, 22 Jan 2019 15:51:33 +0100 Subject: Coordinate operation computation with CRS with extension string: replace datum by ellps --- test/unit/test_operation.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'test/unit/test_operation.cpp') diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp index 01c6a38f..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(objDest); ASSERT_TRUE(dest != nullptr); @@ -6313,7 +6313,6 @@ 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"); } -- cgit v1.2.3