aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_factory.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-10-08 20:59:19 +0200
committerEven Rouault <even.rouault@spatialys.com>2020-11-01 12:57:34 +0100
commit1e5acb00a0c0fc2533b9bce2e5803da10ed1d8d6 (patch)
treedf572ae12dfec9333a8931886dd3ce221a65edf8 /test/unit/test_factory.cpp
parentc2b0dcc468b4e722e46fe10fca93fe70a95fcb8e (diff)
downloadPROJ-1e5acb00a0c0fc2533b9bce2e5803da10ed1d8d6.tar.gz
PROJ-1e5acb00a0c0fc2533b9bce2e5803da10ed1d8d6.zip
projinfo / createObjectsFromName(): support returning a datum ensemble
Diffstat (limited to 'test/unit/test_factory.cpp')
-rw-r--r--test/unit/test_factory.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp
index 681ac810..8e9b7ab6 100644
--- a/test/unit/test_factory.cpp
+++ b/test/unit/test_factory.cpp
@@ -3186,6 +3186,29 @@ TEST(factory, createObjectsFromName) {
.size(),
1U);
+ {
+ auto res = factory->createObjectsFromName(
+ "World Geodetic System 1984 ensemble",
+ {AuthorityFactory::ObjectType::DATUM_ENSEMBLE}, false);
+ EXPECT_EQ(res.size(), 1U);
+ if (!res.empty()) {
+ EXPECT_EQ(res.front()->getEPSGCode(), 6326);
+ EXPECT_TRUE(dynamic_cast<DatumEnsemble *>(res.front().get()) !=
+ nullptr);
+ }
+ }
+
+ {
+ auto res = factory->createObjectsFromName(
+ "World Geodetic System 1984 ensemble", {}, false);
+ EXPECT_EQ(res.size(), 1U);
+ if (!res.empty()) {
+ EXPECT_EQ(res.front()->getEPSGCode(), 6326);
+ EXPECT_TRUE(dynamic_cast<DatumEnsemble *>(res.front().get()) !=
+ nullptr);
+ }
+ }
+
const auto types = std::vector<AuthorityFactory::ObjectType>{
AuthorityFactory::ObjectType::PRIME_MERIDIAN,
AuthorityFactory::ObjectType::ELLIPSOID,
@@ -3207,6 +3230,7 @@ TEST(factory, createObjectsFromName) {
AuthorityFactory::ObjectType::CONVERSION,
AuthorityFactory::ObjectType::TRANSFORMATION,
AuthorityFactory::ObjectType::CONCATENATED_OPERATION,
+ AuthorityFactory::ObjectType::DATUM_ENSEMBLE,
};
for (const auto type : types) {
factory->createObjectsFromName("i_dont_exist", {type}, false, 1);