diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-12-09 16:45:15 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-09 16:45:15 +0100 |
| commit | 7dece4d27656fccca270c5d6a166a431917ac43a (patch) | |
| tree | dd5eb4f05a11c048303d0b0f80128eb20b6bbc2a /test | |
| parent | 7a9b6566ac02d8c408f4f3758bfa5fcc3e90b552 (diff) | |
| parent | d285111ffb46de0cf482f5847d003b1b8ba201ca (diff) | |
| download | PROJ-7dece4d27656fccca270c5d6a166a431917ac43a.tar.gz PROJ-7dece4d27656fccca270c5d6a166a431917ac43a.zip | |
Merge pull request #2976 from rouault/compound_to_compound_ballpark
createOperations(): improvement for "NAD83(CSRS) + CGVD28 height" to "NAD83(CSRS) + CGVD2013(CGG2013) height"
Diffstat (limited to 'test')
| -rw-r--r-- | test/unit/test_operationfactory.cpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/test/unit/test_operationfactory.cpp b/test/unit/test_operationfactory.cpp index a445d8c7..e387b7ab 100644 --- a/test/unit/test_operationfactory.cpp +++ b/test/unit/test_operationfactory.cpp @@ -4518,6 +4518,63 @@ TEST(operation, compoundCRS_to_compoundCRS_issue_2720) { // --------------------------------------------------------------------------- +TEST( + operation, + compoundCRS_to_compoundCRS_concatenated_operation_with_two_vert_transformation_and_ballpark_geog) { + auto authFactory = + AuthorityFactory::create(DatabaseContext::create(), "EPSG"); + // "NAD83(CSRS) + CGVD28 height" + auto srcObj = createFromUserInput("EPSG:4617+5713", + authFactory->databaseContext(), false); + auto src = nn_dynamic_pointer_cast<CRS>(srcObj); + ASSERT_TRUE(src != nullptr); + + // "NAD83(CSRS) + CGVD2013(CGG2013) height" + auto dstObj = createFromUserInput("EPSG:4617+6647", + authFactory->databaseContext(), false); + auto dst = nn_dynamic_pointer_cast<CRS>(dstObj); + ASSERT_TRUE(dst != nullptr); + + // That transformation involves doing CGVD28 height to CGVD2013(CGG2013) + // height by doing: + // - CGVD28 height to NAD83(CSRS): EPSG registered operation + // - NAD83(CSRS) to CGVD2013(CGG2013) height by doing: + // * NAD83(CSRS) to NAD83(CSRS)v6: ballpark + // * NAD83(CSRS)v6 to CGVD2013(CGG2013): EPSG registered operation + auto ctxt = CoordinateOperationContext::create(authFactory, nullptr, 0.0); + ctxt->setSpatialCriterion( + CoordinateOperationContext::SpatialCriterion::PARTIAL_INTERSECTION); + { + auto list = CoordinateOperationFactory::create()->createOperations( + NN_NO_CHECK(src), NN_NO_CHECK(dst), ctxt); + ASSERT_GE(list.size(), 1U); + // Check that we have the transformation using NAD83(CSRS)v6 first + // (as well as the one between NAD83(CSRS) to CGVD28 height) + EXPECT_EQ(list[0]->nameStr(), + "Inverse of NAD83(CSRS) to CGVD28 height (1) + " + "Inverse of Ballpark geographic offset from NAD83(CSRS)v6 to " + "NAD83(CSRS) + " + "NAD83(CSRS)v6 to CGVD2013(CGG2013) height (1) + " + "Inverse of Ballpark geographic offset from NAD83(CSRS) to " + "NAD83(CSRS)v6"); + } + { + auto list = CoordinateOperationFactory::create()->createOperations( + NN_NO_CHECK(dst), NN_NO_CHECK(src), ctxt); + ASSERT_GE(list.size(), 1U); + // Check that we have the transformation using NAD83(CSRS)v6 first + // (as well as the one between NAD83(CSRS) to CGVD28 height) + EXPECT_EQ( + list[0]->nameStr(), + "Ballpark geographic offset from NAD83(CSRS) to NAD83(CSRS)v6 + " + "Inverse of NAD83(CSRS)v6 to CGVD2013(CGG2013) height (1) + " + "Ballpark geographic offset from NAD83(CSRS)v6 to NAD83(CSRS) + " + "NAD83(CSRS) to CGVD28 height (1)"); + } +} + +// --------------------------------------------------------------------------- + TEST(operation, vertCRS_to_vertCRS) { auto vertcrs_m_obj = PROJStringParser().createFromPROJString("+vunits=m"); |
