diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-10-08 00:51:00 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-10-08 17:31:57 +0200 |
| commit | 492c95ce77f4ebdab401c6fcc2d1dae5c6b5c401 (patch) | |
| tree | 76c9114cd76d6b3243a84db69c5f449d831cd2ef /test/unit | |
| parent | 53672bdf7074e3737f6e6a53ee7373dcbccd6ea4 (diff) | |
| download | PROJ-492c95ce77f4ebdab401c6fcc2d1dae5c6b5c401.tar.gz PROJ-492c95ce77f4ebdab401c6fcc2d1dae5c6b5c401.zip | |
Make createOperations() work with DatumEnsemble
Diffstat (limited to 'test/unit')
| -rw-r--r-- | test/unit/test_operation.cpp | 48 |
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"); |
