From c2b0dcc468b4e722e46fe10fca93fe70a95fcb8e Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 8 Oct 2020 18:41:57 +0200 Subject: When reading from database, possibly return VerticalCRS with a DatumEnsemble Only occurence for now is EPSG:9451 'BI height' using the 'British Isles height ensemble' --- test/unit/test_factory.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index c869fa50..681ac810 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -619,6 +619,20 @@ TEST(factory, AuthorityFactory_createVerticalCRS) { // --------------------------------------------------------------------------- +TEST(factory, AuthorityFactory_createVerticalCRS_with_datum_ensemble) { + auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG"); + EXPECT_THROW(factory->createVerticalCRS("-1"), + NoSuchAuthorityCodeException); + + auto crs = factory->createVerticalCRS("9451"); // BI height + ASSERT_TRUE(crs->datum() == nullptr); + ASSERT_TRUE(crs->datumEnsemble() != nullptr); + EXPECT_TRUE(crs->datumEnsemble()->isEquivalentTo( + factory->createDatumEnsemble("1288").get())); +} + +// --------------------------------------------------------------------------- + TEST(factory, AuthorityFactory_createConversion) { auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG"); EXPECT_THROW(factory->createConversion("-1"), NoSuchAuthorityCodeException); -- cgit v1.2.3