aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-10-11 19:50:09 +0200
committerEven Rouault <even.rouault@spatialys.com>2020-10-11 19:50:09 +0200
commitad80dc88a70032e1d96812b574b2d4d22e223394 (patch)
treebe61efbce545fc2940861e218e2e1f448f1bb66f /test
parentacd1cf3278a532b56f3f621e27a8895b3db3cb75 (diff)
downloadPROJ-ad80dc88a70032e1d96812b574b2d4d22e223394.tar.gz
PROJ-ad80dc88a70032e1d96812b574b2d4d22e223394.zip
Database: add a frame_reference_epoch column in vertical_datum to be able to handle dynamic vertical datums, and instanciate them properly from database
Diffstat (limited to 'test')
-rw-r--r--test/cli/testprojinfo_out.dist2
-rw-r--r--test/unit/test_factory.cpp14
2 files changed, 15 insertions, 1 deletions
diff --git a/test/cli/testprojinfo_out.dist b/test/cli/testprojinfo_out.dist
index 4ba7304e..42000716 100644
--- a/test/cli/testprojinfo_out.dist
+++ b/test/cli/testprojinfo_out.dist
@@ -912,6 +912,8 @@ WKT2:2019 string:
COORDINATEOPERATION["Inverse of SWEREF99 to RH2000 height",
SOURCECRS[
VERTCRS["RH2000 height",
+ DYNAMIC[
+ FRAMEEPOCH[2000]],
VDATUM["Rikets hojdsystem 2000"],
CS[vertical,1],
AXIS["gravity-related height (H)",up,
diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp
index b17a3077..366e3d9b 100644
--- a/test/unit/test_factory.cpp
+++ b/test/unit/test_factory.cpp
@@ -301,6 +301,18 @@ TEST(factory, AuthorityFactory_createVerticalDatum) {
auto extent = domain->domainOfValidity();
ASSERT_TRUE(extent != nullptr);
EXPECT_TRUE(extent->isEquivalentTo(factory->createExtent("1262").get()));
+ EXPECT_TRUE(vrf->publicationDate().has_value());
+ EXPECT_EQ(vrf->publicationDate()->toString(), "2008-01-01");
+}
+
+// ---------------------------------------------------------------------------
+
+TEST(factory, AuthorityFactory_createDynamicVerticalDatum) {
+ auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG");
+ auto grf = factory->createVerticalDatum("1096"); // Norway Normal Null 2000
+ auto dvrf = nn_dynamic_pointer_cast<DynamicVerticalReferenceFrame>(grf);
+ ASSERT_TRUE(dvrf != nullptr);
+ EXPECT_EQ(dvrf->frameReferenceEpoch().value(), 2000.0);
}
// ---------------------------------------------------------------------------
@@ -1540,7 +1552,7 @@ class FactoryWithTmpDatabase : public ::testing::Test {
<< last_error();
ASSERT_TRUE(
execute("INSERT INTO vertical_datum VALUES('EPSG','1027','EGM2008 "
- "geoid',NULL,NULL,NULL,0);"))
+ "geoid',NULL,NULL,NULL,NULL,0);"))
<< last_error();
ASSERT_TRUE(execute("INSERT INTO usage VALUES('EPSG',"
"'vertical_datum_1027_usage','vertical_datum',"