aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_operation.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-10-16 18:26:09 +0200
committerGitHub <noreply@github.com>2020-10-16 18:26:09 +0200
commit82b496fb32df0b6705159cd5c626aab20c8e9d39 (patch)
treeb6652073c9d66960e5c16d61055c53ffc3f8656f /test/unit/test_operation.cpp
parent93508fbec18e192646f2890e1ceb86de4cc9fd35 (diff)
parent686713479eb0b39feb5369b82647f96edf809b6c (diff)
downloadPROJ-82b496fb32df0b6705159cd5c626aab20c8e9d39.tar.gz
PROJ-82b496fb32df0b6705159cd5c626aab20c8e9d39.zip
Merge pull request #2370 from rouault/epsg10
Update to EPSG 10.003 and make code base robust to dealing with WKT CRS with DatumEnsemble
Diffstat (limited to 'test/unit/test_operation.cpp')
-rw-r--r--test/unit/test_operation.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp
index c7c0a262..ce4b866b 100644
--- a/test/unit/test_operation.cpp
+++ b/test/unit/test_operation.cpp
@@ -4807,6 +4807,54 @@ TEST(operation, geogCRS_to_geogCRS_context_invalid_EPSG_ID) {
// ---------------------------------------------------------------------------
+TEST(operation, geogCRS_to_geogCRS_context_datum_ensemble) {
+ auto authFactory =
+ AuthorityFactory::create(DatabaseContext::create(), "EPSG");
+ auto ctxt = CoordinateOperationContext::create(authFactory, nullptr, 0);
+
+ auto dst_wkt =
+ "GEOGCRS[\"unknown\","
+ " ENSEMBLE[\"World Geodetic System 1984 ensemble\","
+ " MEMBER[\"World Geodetic System 1984 (Transit)\","
+ " ID[\"EPSG\",1166]],"
+ " MEMBER[\"World Geodetic System 1984 (G730)\","
+ " ID[\"EPSG\",1152]],"
+ " MEMBER[\"World Geodetic System 1984 (G873)\","
+ " ID[\"EPSG\",1153]],"
+ " MEMBER[\"World Geodetic System 1984 (G1150)\","
+ " ID[\"EPSG\",1154]],"
+ " MEMBER[\"World Geodetic System 1984 (G1674)\","
+ " ID[\"EPSG\",1155]],"
+ " MEMBER[\"World Geodetic System 1984 (G1762)\","
+ " ID[\"EPSG\",1156]],"
+ " ELLIPSOID[\"WGS 84\",6378137,298.257223563,"
+ " LENGTHUNIT[\"metre\",1,ID[\"EPSG\",9001]],"
+ " ID[\"EPSG\",7030]],"
+ " ENSEMBLEACCURACY[2]],"
+ " PRIMEM[\"Greenwich\",0,"
+ " ANGLEUNIT[\"degree\",0.0174532925199433,ID[\"EPSG\",9102]],"
+ " ID[\"EPSG\",8901]],"
+ " CS[ellipsoidal,2,"
+ " ID[\"EPSG\",6422]],"
+ " AXIS[\"Geodetic latitude (Lat)\",north,"
+ " ORDER[1]],"
+ " AXIS[\"Geodetic longitude (Lon)\",east,"
+ " ORDER[2]],"
+ " ANGLEUNIT[\"degree (supplier to define representation)\","
+ "0.0174532925199433,ID[\"EPSG\",9122]]]";
+ auto dstObj = WKTParser().createFromWKT(dst_wkt);
+ auto dstCRS = nn_dynamic_pointer_cast<CRS>(dstObj);
+ ASSERT_TRUE(dstCRS != nullptr);
+
+ auto list = CoordinateOperationFactory::create()->createOperations(
+ authFactory->createCoordinateReferenceSystem("4258"), // ETRS89
+ NN_NO_CHECK(dstCRS), ctxt);
+ ASSERT_EQ(list.size(), 1U);
+ EXPECT_EQ(list[0]->nameStr(), "ETRS89 to WGS 84 (1)");
+}
+
+// ---------------------------------------------------------------------------
+
TEST(operation, vertCRS_to_geogCRS_context) {
auto authFactory =
AuthorityFactory::create(DatabaseContext::create(), "EPSG");