From dd79ca70edcee3dc4f5485a87e11e52cfa2ea041 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 18 Apr 2021 14:11:44 +0200 Subject: createOperations(): fix Geog to Geog when one is deprecated (fix master regression) --- test/unit/test_operationfactory.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test') diff --git a/test/unit/test_operationfactory.cpp b/test/unit/test_operationfactory.cpp index 7e33ca72..4c204c21 100644 --- a/test/unit/test_operationfactory.cpp +++ b/test/unit/test_operationfactory.cpp @@ -1033,6 +1033,22 @@ TEST(operation, geogCRS_to_geogCRS_init_IGNF_to_init_IGNF_context) { // --------------------------------------------------------------------------- +TEST(operation, geogCRS_to_geogCRS_context_deprecated) { + auto authFactory = + AuthorityFactory::create(DatabaseContext::create(), "EPSG"); + auto ctxt = CoordinateOperationContext::create(authFactory, nullptr, 0.0); + auto list = CoordinateOperationFactory::create()->createOperations( + authFactory->createCoordinateReferenceSystem( + "4226"), // Cote d'Ivoire (deprecated) + authFactory->createCoordinateReferenceSystem("4258"), // ETRS89 + ctxt); + ASSERT_TRUE(!list.empty()); + EXPECT_EQ(list[0]->nameStr(), + "Ballpark geographic offset from Cote d'Ivoire to ETRS89"); +} + +// --------------------------------------------------------------------------- + TEST(operation, geogCRS_to_geogCRS_3D) { auto geogcrs_m_obj = PROJStringParser().createFromPROJString( -- cgit v1.2.3