aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-12-08 17:41:48 +0100
committerEven Rouault <even.rouault@spatialys.com>2021-12-08 17:41:48 +0100
commitd285111ffb46de0cf482f5847d003b1b8ba201ca (patch)
treec660cb3038712ff087c039ce19d0de715ccbd099 /test
parentea719555f86399325b6d90840f8b3d4508b6e9bc (diff)
downloadPROJ-d285111ffb46de0cf482f5847d003b1b8ba201ca.tar.gz
PROJ-d285111ffb46de0cf482f5847d003b1b8ba201ca.zip
createOperations(): improvement for "NAD83(CSRS) + CGVD28 height" to "NAD83(CSRS) + CGVD2013(CGG2013) height"
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
Diffstat (limited to 'test')
-rw-r--r--test/unit/test_operationfactory.cpp57
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");