From 457b173cbe8fdb790b011d1828a0fd9f8f6221a4 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Wed, 6 Feb 2019 14:26:06 +0100 Subject: ISO19111: Handle database area objects with no bounding box --- test/unit/test_factory.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/unit/test_factory.cpp') diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp index 81f745f5..95436c75 100644 --- a/test/unit/test_factory.cpp +++ b/test/unit/test_factory.cpp @@ -222,6 +222,16 @@ TEST(factory, AuthorityFactory_createExtent) { // --------------------------------------------------------------------------- +TEST(factory, AuthorityFactory_createExtent_no_bbox) { + auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG"); + auto extent = factory->createExtent("1361"); // Sudan - south. Deprecated + EXPECT_EQ(*(extent->description()), "Sudan - south"); + const auto &geogElts = extent->geographicElements(); + EXPECT_TRUE(geogElts.empty()); +} + +// --------------------------------------------------------------------------- + TEST(factory, AuthorityFactory_createGeodeticDatum) { auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG"); EXPECT_THROW(factory->createGeodeticDatum("-1"), @@ -414,6 +424,17 @@ TEST(factory, AuthorityFactory_createGeodeticCRS_geographic2D) { // --------------------------------------------------------------------------- +TEST(factory, AuthorityFactory_createGeodeticCRS_geographic2D_area_no_bbox) { + auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG"); + auto crs = factory->createGeodeticCRS("4296"); // Sudan - deprecated + auto domain = crs->domains()[0]; + auto extent = domain->domainOfValidity(); + ASSERT_TRUE(extent != nullptr); + EXPECT_TRUE(extent->isEquivalentTo(factory->createExtent("1361").get())); +} + +// --------------------------------------------------------------------------- + TEST(factory, AuthorityFactory_createGeodeticCRS_geographic3D) { auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG"); auto crs = factory->createGeodeticCRS("4979"); -- cgit v1.2.3