aboutsummaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/test_c_api.cpp1
-rw-r--r--test/unit/test_crs.cpp21
-rw-r--r--test/unit/test_factory.cpp4
3 files changed, 24 insertions, 2 deletions
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp
index dccd2fce..1049ce35 100644
--- a/test/unit/test_c_api.cpp
+++ b/test/unit/test_c_api.cpp
@@ -5199,6 +5199,7 @@ TEST_F(CApi, proj_create_derived_geographic_crs) {
" MEMBER[\"World Geodetic System 1984 (G1150)\"],\n"
" MEMBER[\"World Geodetic System 1984 (G1674)\"],\n"
" MEMBER[\"World Geodetic System 1984 (G1762)\"],\n"
+ " MEMBER[\"World Geodetic System 1984 (G2139)\"],\n"
" ELLIPSOID[\"WGS 84\",6378137,298.257223563,\n"
" LENGTHUNIT[\"metre\",1]],\n"
" ENSEMBLEACCURACY[2.0]],\n"
diff --git a/test/unit/test_crs.cpp b/test/unit/test_crs.cpp
index 42e6018b..c9c0c9a1 100644
--- a/test/unit/test_crs.cpp
+++ b/test/unit/test_crs.cpp
@@ -1639,6 +1639,24 @@ TEST(crs, geodeticcrs_identify_db) {
}
{
+ // Test identification from PROJ string with just the ellipsoid
+ auto obj = PROJStringParser().createFromPROJString(
+ "+proj=longlat +ellps=GRS80 +type=crs");
+ auto crs = nn_dynamic_pointer_cast<GeographicCRS>(obj);
+ ASSERT_TRUE(crs != nullptr);
+ auto res = crs->identify(factory);
+ bool foundGDA2020 = false;
+ for (const auto &pair : res) {
+ // one among many others...
+ if (pair.first->getEPSGCode() == 7844) {
+ foundGDA2020 = true;
+ EXPECT_EQ(pair.second, 60);
+ }
+ }
+ EXPECT_TRUE(foundGDA2020);
+ }
+
+ {
// Identify by code, but datum name is an alias of the official one
auto wkt = "GEOGCRS[\"GDA2020\",\n"
" DATUM[\"GDA2020\",\n"
@@ -5401,6 +5419,9 @@ TEST(crs, derivedProjectedCRS_WKT2_2019) {
EXPECT_TRUE(crs->isEquivalentTo(crs.get()));
EXPECT_TRUE(crs->shallowClone()->isEquivalentTo(crs.get()));
EXPECT_FALSE(crs->isEquivalentTo(createUnrelatedObject().get()));
+
+ auto geodCRS = crs->extractGeodeticCRS();
+ EXPECT_TRUE(geodCRS != nullptr);
}
// ---------------------------------------------------------------------------
diff --git a/test/unit/test_factory.cpp b/test/unit/test_factory.cpp
index eb362415..9319968d 100644
--- a/test/unit/test_factory.cpp
+++ b/test/unit/test_factory.cpp
@@ -339,7 +339,7 @@ TEST(factory, AuthorityFactory_createDatumEnsembleGeodetic) {
ASSERT_EQ(ensemble->identifiers().size(), 1U);
EXPECT_EQ(ensemble->identifiers()[0]->code(), "6326");
EXPECT_EQ(*(ensemble->identifiers()[0]->codeSpace()), "EPSG");
- EXPECT_EQ(ensemble->datums().size(), 6U);
+ EXPECT_EQ(ensemble->datums().size(), 7U);
EXPECT_EQ(ensemble->positionalAccuracy()->value(), "2.0");
ASSERT_TRUE(!ensemble->domains().empty());
auto domain = ensemble->domains()[0];
@@ -3263,7 +3263,7 @@ TEST(factory, createObjectsFromName) {
// EPSG:4326 and the 6 WGS84 realizations
// and EPSG:7881 'Tritan St. Helena'' whose alias is
// 'WGS 84 Tritan St. Helena'
- EXPECT_EQ(res.size(), 8U);
+ EXPECT_EQ(res.size(), 9U);
if (!res.empty()) {
EXPECT_EQ(res.front()->getEPSGCode(), 4326);
}