aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-10-05 14:56:41 +0200
committerEven Rouault <even.rouault@spatialys.com>2020-10-06 23:48:52 +0200
commit2cfdd6f7fc683517a62147feace1b98b3f587abc (patch)
tree695468cff547ebdba0d575e77a65d0ac292c85af /test
parent4c992038ea01ead56df12f468f29325f7ca9e43d (diff)
downloadPROJ-2cfdd6f7fc683517a62147feace1b98b3f587abc.tar.gz
PROJ-2cfdd6f7fc683517a62147feace1b98b3f587abc.zip
Database: instanciate DynamicGeodeticReferenceFrame (things like ITRFxxx, WGS 84 (Gxxxx), etc.) when possible
Diffstat (limited to 'test')
-rw-r--r--test/unit/test_factory.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp
index 90990a96..6950c88e 100644
--- a/test/unit/test_factory.cpp
+++ b/test/unit/test_factory.cpp
@@ -246,6 +246,8 @@ TEST(factory, AuthorityFactory_createGeodeticDatum) {
EXPECT_THROW(factory->createGeodeticDatum("-1"),
NoSuchAuthorityCodeException);
auto grf = factory->createGeodeticDatum("6326");
+ EXPECT_TRUE(nn_dynamic_pointer_cast<DynamicGeodeticReferenceFrame>(grf) ==
+ nullptr);
ASSERT_EQ(grf->identifiers().size(), 1U);
EXPECT_EQ(grf->identifiers()[0]->code(), "6326");
EXPECT_EQ(*(grf->identifiers()[0]->codeSpace()), "EPSG");
@@ -266,10 +268,22 @@ TEST(factory, AuthorityFactory_createGeodeticDatum) {
TEST(factory, AuthorityFactory_createGeodeticDatum_with_publication_date) {
auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG");
- //'World Geodetic System 1984 (G1762)
- auto grf = factory->createGeodeticDatum("1156");
+ // North American Datum 1983
+ auto grf = factory->createGeodeticDatum("6269");
+ EXPECT_TRUE(nn_dynamic_pointer_cast<DynamicGeodeticReferenceFrame>(grf) ==
+ nullptr);
EXPECT_TRUE(grf->publicationDate().has_value());
- EXPECT_EQ(grf->publicationDate()->toString(), "2005-01-01");
+ EXPECT_EQ(grf->publicationDate()->toString(), "1986-01-01");
+}
+
+// ---------------------------------------------------------------------------
+
+TEST(factory, AuthorityFactory_createDynamicGeodeticDatum) {
+ auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG");
+ auto grf = factory->createGeodeticDatum("1165"); // ITRF 2014
+ auto dgrf = nn_dynamic_pointer_cast<DynamicGeodeticReferenceFrame>(grf);
+ ASSERT_TRUE(dgrf != nullptr);
+ EXPECT_EQ(dgrf->frameReferenceEpoch().value(), 2010.0);
}
// ---------------------------------------------------------------------------
@@ -747,6 +761,8 @@ TEST(factory, AuthorityFactory_createCoordinateOperation_helmert_15_CF) {
" VERSION[\"GA-Aus 2010\"],\n"
" SOURCECRS[\n"
" GEODCRS[\"ITRF2008\",\n"
+ " DYNAMIC[\n"
+ " FRAMEEPOCH[2005]],\n"
" DATUM[\"International Terrestrial Reference Frame "
"2008\",\n"
" ELLIPSOID[\"GRS 1980\",6378137,298.257222101,\n"