diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-03-28 16:33:26 +0000 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-03-28 16:33:26 +0000 |
| commit | 45ce4a8c780c4408c4dbe58f8dce0713086ea50b (patch) | |
| tree | eade55bee10bf4cccb3b246c6e654599932597fb /test | |
| parent | a42cfd4d82ef8010bebbf3fa591c538620bc1e49 (diff) | |
| download | PROJ-45ce4a8c780c4408c4dbe58f8dce0713086ea50b.tar.gz PROJ-45ce4a8c780c4408c4dbe58f8dce0713086ea50b.zip | |
createOperations(): improve BoundCRS<-->non-bound-CRS case
Fixes #1388
Typically helps for
projinfo -s "+proj=longlat +ellps=GRS80 +towgs84=1,2,3 +type=crs" -t EPSG:4258
by researching operations from the pivot WGS84 implied by the towgs84 clause
to EPSG:4258.
Diffstat (limited to 'test')
| -rw-r--r-- | test/unit/test_operation.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp index 0f719a6d..3f8fb37c 100644 --- a/test/unit/test_operation.cpp +++ b/test/unit/test_operation.cpp @@ -5485,6 +5485,38 @@ TEST(operation, boundCRS_of_geogCRS_to_projCRS) { // --------------------------------------------------------------------------- +TEST(operation, boundCRS_of_geogCRS_to_unrelated_geogCRS_context) { + auto src = BoundCRS::createFromTOWGS84( + GeographicCRS::EPSG_4807, std::vector<double>{1, 2, 3, 4, 5, 6, 7}); + auto authFactory = + AuthorityFactory::create(DatabaseContext::create(), "EPSG"); + // ETRS89 + auto dst = authFactory->createCoordinateReferenceSystem("4258"); + auto ctxt = CoordinateOperationContext::create(authFactory, nullptr, 0.0); + auto list = + CoordinateOperationFactory::create()->createOperations(src, dst, ctxt); + ASSERT_EQ(list.size(), 1U); + // Check with it is a concatenated operation, since it doesn't particularly + // show up in the PROJ string + EXPECT_TRUE(dynamic_cast<ConcatenatedOperation *>(list[0].get()) != + nullptr); + EXPECT_EQ(list[0]->nameStr(), "Transformation from NTF (Paris) to WGS84 + " + "Inverse of ETRS89 to WGS 84 (1)"); + EXPECT_EQ(list[0]->exportToPROJString(PROJStringFormatter::create().get()), + "+proj=pipeline " + "+step +proj=axisswap +order=2,1 " + "+step +proj=unitconvert +xy_in=grad +xy_out=rad " + "+step +inv +proj=longlat +ellps=clrk80ign +pm=paris " + "+step +proj=push +v_3 +step +proj=cart +ellps=clrk80ign " + "+step +proj=helmert +x=1 +y=2 +z=3 +rx=4 +ry=5 +rz=6 +s=7 " + "+convention=position_vector " + "+step +inv +proj=cart +ellps=GRS80 +step +proj=pop +v_3 " + "+step +proj=unitconvert +xy_in=rad +xy_out=deg " + "+step +proj=axisswap +order=2,1"); +} + +// --------------------------------------------------------------------------- + TEST(operation, geogCRS_to_boundCRS_of_geogCRS) { auto boundCRS = BoundCRS::createFromTOWGS84( GeographicCRS::EPSG_4807, std::vector<double>{1, 2, 3, 4, 5, 6, 7}); |
