@@ -5485,6 +5485,38 @@ TEST(operation, boundCRS_of_geogCRS_to_projCRS) {
5485
5485
5486
5486
// ---------------------------------------------------------------------------
5487
5487
5488
+ TEST(operation, boundCRS_of_geogCRS_to_unrelated_geogCRS_context) {
5489
+ auto src = BoundCRS::createFromTOWGS84(
5490
+ GeographicCRS::EPSG_4807, std::vector<double>{1, 2, 3, 4, 5, 6, 7});
5491
+ auto authFactory =
5492
+ AuthorityFactory::create(DatabaseContext::create(), "EPSG");
5493
+ // ETRS89
5494
+ auto dst = authFactory->createCoordinateReferenceSystem("4258");
5495
+ auto ctxt = CoordinateOperationContext::create(authFactory, nullptr, 0.0);
5496
+ auto list =
5497
+ CoordinateOperationFactory::create()->createOperations(src, dst, ctxt);
5498
+ ASSERT_EQ(list.size(), 1U);
5499
+ // Check with it is a concatenated operation, since it doesn't particularly
5500
+ // show up in the PROJ string
5501
+ EXPECT_TRUE(dynamic_cast<ConcatenatedOperation *>(list[0].get()) !=
5502
+ nullptr);
5503
+ EXPECT_EQ(list[0]->nameStr(), "Transformation from NTF (Paris) to WGS84 + "
5504
+ "Inverse of ETRS89 to WGS 84 (1)");
5505
+ EXPECT_EQ(list[0]->exportToPROJString(PROJStringFormatter::create().get()),
5506
+ "+proj=pipeline "
5507
+ "+step +proj=axisswap +order=2,1 "
5508
+ "+step +proj=unitconvert +xy_in=grad +xy_out=rad "
5509
+ "+step +inv +proj=longlat +ellps=clrk80ign +pm=paris "
5510
+ "+step +proj=push +v_3 +step +proj=cart +ellps=clrk80ign "
5511
+ "+step +proj=helmert +x=1 +y=2 +z=3 +rx=4 +ry=5 +rz=6 +s=7 "
5512
+ "+convention=position_vector "
5513
+ "+step +inv +proj=cart +ellps=GRS80 +step +proj=pop +v_3 "
5514
+ "+step +proj=unitconvert +xy_in=rad +xy_out=deg "
5515
+ "+step +proj=axisswap +order=2,1");
5516
+ }
5517
+
5518
+ // ---------------------------------------------------------------------------
5519
+
5488
5520
TEST(operation, geogCRS_to_boundCRS_of_geogCRS) {
5489
5521
auto boundCRS = BoundCRS::createFromTOWGS84(
5490
5522
GeographicCRS::EPSG_4807, std::vector<double>{1, 2, 3, 4, 5, 6, 7});
0 commit comments