diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-03-29 23:11:20 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-03-30 00:37:17 +0200 |
| commit | 64946ab103d66508bf56bf80417bb5d69876bd25 (patch) | |
| tree | 600c12b88b003ae27d06a306222fc6a42a59e727 /test/unit/test_operation.cpp | |
| parent | b84c9d0cb61f3bd561da6092e15e294ae7e410e0 (diff) | |
| download | PROJ-64946ab103d66508bf56bf80417bb5d69876bd25.tar.gz PROJ-64946ab103d66508bf56bf80417bb5d69876bd25.zip | |
Fix working of Helmert transform between the horizontal part of 2 compoundCRS (fixes #2108)
Diffstat (limited to 'test/unit/test_operation.cpp')
| -rw-r--r-- | test/unit/test_operation.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp index 076686b4..ad218899 100644 --- a/test/unit/test_operation.cpp +++ b/test/unit/test_operation.cpp @@ -7347,6 +7347,32 @@ TEST(operation, compoundCRS_to_compoundCRS_context) { // --------------------------------------------------------------------------- +TEST(operation, compoundCRS_to_compoundCRS_context_helmert_noop) { + auto dbContext = DatabaseContext::create(); + auto authFactory = AuthorityFactory::create(dbContext, "EPSG"); + auto ctxt = CoordinateOperationContext::create(authFactory, nullptr, 0.0); + ctxt->setGridAvailabilityUse( + CoordinateOperationContext::GridAvailabilityUse:: + IGNORE_GRID_AVAILABILITY); + ctxt->setSpatialCriterion( + CoordinateOperationContext::SpatialCriterion::PARTIAL_INTERSECTION); + // WGS84 + EGM96 + auto objSrc = createFromUserInput("EPSG:4326+3855", dbContext); + auto srcCrs = nn_dynamic_pointer_cast<CompoundCRS>(objSrc); + ASSERT_TRUE(srcCrs != nullptr); + // ETRS89 + EGM96 + auto objDest = createFromUserInput("EPSG:4258+3855", dbContext); + auto destCrs = nn_dynamic_pointer_cast<CompoundCRS>(objDest); + ASSERT_TRUE(destCrs != nullptr); + auto list = CoordinateOperationFactory::create()->createOperations( + NN_NO_CHECK(srcCrs), NN_NO_CHECK(destCrs), ctxt); + ASSERT_GE(list.size(), 1U); + EXPECT_EQ(list[0]->exportToPROJString(PROJStringFormatter::create().get()), + "+proj=noop"); +} + +// --------------------------------------------------------------------------- + TEST(operation, vertCRS_to_vertCRS) { auto vertcrs_m_obj = PROJStringParser().createFromPROJString("+vunits=m"); |
