From 46c6ddf84defeb4ae855285da4416dff7178cacc Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 27 Oct 2019 19:16:04 +0100 Subject: Database: add an auxiliary concatenated_operation_step table to allow arbitrary number of steps (fixes #1632) EPSG:9103 (NAD27 to ITRF2014 (1)) is now handled. Note:EPSG:9104 (NAD27 to ITRF2014 (2)) is not currently, since it uses for step EPSG:8861 (NAD83(HARN) to NAD83(FBN) (1)) an unsupported transformation method (NADCON5 (3D), EPSG:1075). --- test/unit/test_factory.cpp | 43 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 37 insertions(+), 6 deletions(-) (limited to 'test/unit/test_factory.cpp') diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index 7784d8a2..47cee060 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -1116,6 +1116,28 @@ TEST( // --------------------------------------------------------------------------- +TEST( + factory, + AuthorityFactory_createCoordinateOperation_concatenated_operation_epsg_9103) { + auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG"); + auto op = factory->createCoordinateOperation("9103", false); + auto concatenated = nn_dynamic_pointer_cast(op); + ASSERT_TRUE(concatenated != nullptr); + auto operations = concatenated->operations(); + ASSERT_EQ(operations.size(), + 5U); // we've added an explicit geographic -> geocentric step + EXPECT_EQ(operations[0]->nameStr(), "NAD27 to NAD83 (1)"); + EXPECT_EQ(operations[1]->nameStr(), "NAD83 to NAD83(2011) (1)"); + EXPECT_EQ( + operations[2]->nameStr(), + "Conversion from NAD83(2011) (geog2D) to NAD83(2011) (geocentric)"); + EXPECT_EQ(operations[3]->nameStr(), + "Inverse of ITRF2008 to NAD83(2011) (1)"); + EXPECT_EQ(operations[4]->nameStr(), "ITRF2008 to ITRF2014 (1)"); +} + +// --------------------------------------------------------------------------- + static bool in(const std::string &str, const std::vector &list) { for (const auto &listItem : list) { if (str == listItem) { @@ -1514,12 +1536,21 @@ class FactoryWithTmpDatabase : public ::testing::Test { "NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);")) << last_error(); - ASSERT_TRUE(execute( - "INSERT INTO concatenated_operation " - "VALUES('EPSG','DUMMY_CONCATENATED','name',NULL,NULL," - "'EPSG','4326','EPSG'" - ",'4326','EPSG','1262',NULL,'EPSG','DUMMY_OTHER_TRANSFORMATION'" - ",'EPSG','DUMMY_OTHER_TRANSFORMATION',NULL,NULL,NULL,0);")) + ASSERT_TRUE( + execute("INSERT INTO concatenated_operation " + "VALUES('EPSG','DUMMY_CONCATENATED','name',NULL,NULL," + "'EPSG','4326','EPSG'" + ",'4326','EPSG','1262',NULL,NULL,0);")) + << last_error(); + + ASSERT_TRUE(execute("INSERT INTO concatenated_operation_step " + "VALUES('EPSG','DUMMY_CONCATENATED',1," + "'EPSG','DUMMY_OTHER_TRANSFORMATION');")) + << last_error(); + + ASSERT_TRUE(execute("INSERT INTO concatenated_operation_step " + "VALUES('EPSG','DUMMY_CONCATENATED',2," + "'EPSG','DUMMY_OTHER_TRANSFORMATION');")) << last_error(); } -- cgit v1.2.3