diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-10-05 19:21:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-05 19:21:05 +0200 |
| commit | c50ba1b1a7ecde946544c03ab0951727dd87264d (patch) | |
| tree | 2be4d809980ba1450d6e8a2af29c4e9822c9f2d1 /test/unit/test_operationfactory.cpp | |
| parent | 6b58adb4b7396b9c2aff2fa26aae2340d5a62d21 (diff) | |
| parent | 5d6bdadfca419c1d54d455e240743791e6cea44e (diff) | |
| download | PROJ-c50ba1b1a7ecde946544c03ab0951727dd87264d.tar.gz PROJ-c50ba1b1a7ecde946544c03ab0951727dd87264d.zip | |
Merge pull request #2876 from rouault/iau
Add IAU_2015 CRS definitions
Diffstat (limited to 'test/unit/test_operationfactory.cpp')
| -rw-r--r-- | test/unit/test_operationfactory.cpp | 132 |
1 files changed, 132 insertions, 0 deletions
diff --git a/test/unit/test_operationfactory.cpp b/test/unit/test_operationfactory.cpp index 31b23287..2246c60c 100644 --- a/test/unit/test_operationfactory.cpp +++ b/test/unit/test_operationfactory.cpp @@ -7010,3 +7010,135 @@ TEST(operation, "+proj=axisswap +order=1,-2"); } } + +// --------------------------------------------------------------------------- + +TEST( + operation, + createOperation_ellipsoidal_ographic_west_to_projected_of_ellipsoidal_ographic_west) { + auto authFactory = + AuthorityFactory::create(DatabaseContext::create(), "IAU_2015"); + auto op = CoordinateOperationFactory::create()->createOperation( + authFactory->createCoordinateReferenceSystem("19901"), + authFactory->createCoordinateReferenceSystem("19911")); + ASSERT_TRUE(op != nullptr); + EXPECT_EQ(op->exportToPROJString(PROJStringFormatter::create().get()), + "+proj=pipeline " + "+step +proj=axisswap +order=-2,1 " + "+step +proj=unitconvert +xy_in=deg +xy_out=rad " + "+step +proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 " + "+a=2440530 +b=2438260 " + "+step +proj=axisswap +order=-1,2"); + + // Inverse + auto op2 = CoordinateOperationFactory::create()->createOperation( + authFactory->createCoordinateReferenceSystem("19911"), + authFactory->createCoordinateReferenceSystem("19901")); + ASSERT_TRUE(op2 != nullptr); + EXPECT_EQ(op2->exportToPROJString(PROJStringFormatter::create().get()), + "+proj=pipeline " + "+step +inv +proj=axisswap +order=-1,2 " + "+step +inv +proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 " + "+a=2440530 +b=2438260 " + "+step +proj=unitconvert +xy_in=rad +xy_out=deg " + "+step +proj=axisswap +order=2,-1"); +} + +// --------------------------------------------------------------------------- + +TEST( + operation, + createOperation_ellipsoidal_ographic_west_to_projected_of_ellipsoidal_ocentric) { + auto authFactory = + AuthorityFactory::create(DatabaseContext::create(), "IAU_2015"); + auto op = CoordinateOperationFactory::create()->createOperation( + authFactory->createCoordinateReferenceSystem("19901"), + authFactory->createCoordinateReferenceSystem("19912")); + ASSERT_TRUE(op != nullptr); + EXPECT_EQ(op->exportToPROJString(PROJStringFormatter::create().get()), + "+proj=pipeline " + "+step +proj=axisswap +order=-2,1 " + "+step +proj=unitconvert +xy_in=deg +xy_out=rad " + "+step +proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 " + "+a=2440530 +b=2438260"); + + // Inverse + auto op2 = CoordinateOperationFactory::create()->createOperation( + authFactory->createCoordinateReferenceSystem("19912"), + authFactory->createCoordinateReferenceSystem("19901")); + ASSERT_TRUE(op2 != nullptr); + EXPECT_EQ(op2->exportToPROJString(PROJStringFormatter::create().get()), + "+proj=pipeline " + "+step +inv +proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 " + "+a=2440530 +b=2438260 " + "+step +proj=unitconvert +xy_in=rad +xy_out=deg " + "+step +proj=axisswap +order=2,-1"); +} + +// --------------------------------------------------------------------------- + +TEST( + operation, + createOperation_ellipsoidal_ocentric_to_projected_of_ellipsoidal_ocentric) { + auto authFactory = + AuthorityFactory::create(DatabaseContext::create(), "IAU_2015"); + auto op = CoordinateOperationFactory::create()->createOperation( + authFactory->createCoordinateReferenceSystem("19902"), + authFactory->createCoordinateReferenceSystem("19912")); + ASSERT_TRUE(op != nullptr); + EXPECT_EQ(op->exportToPROJString(PROJStringFormatter::create().get()), + "+proj=pipeline " + "+step +proj=axisswap +order=2,1 " + "+step +proj=unitconvert +xy_in=deg +xy_out=rad " + "+step +inv +proj=geoc +a=2440530 +b=2438260 " + "+step +proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 " + "+a=2440530 +b=2438260"); + + // Inverse + auto op2 = CoordinateOperationFactory::create()->createOperation( + authFactory->createCoordinateReferenceSystem("19912"), + authFactory->createCoordinateReferenceSystem("19902")); + ASSERT_TRUE(op2 != nullptr); + EXPECT_EQ(op2->exportToPROJString(PROJStringFormatter::create().get()), + "+proj=pipeline " + "+step +inv +proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 " + "+a=2440530 +b=2438260 " + "+step +proj=geoc +a=2440530 +b=2438260 " + "+step +proj=unitconvert +xy_in=rad +xy_out=deg " + "+step +proj=axisswap +order=2,1"); +} + +// --------------------------------------------------------------------------- + +TEST( + operation, + createOperation_ellipsoidal_ocentric_to_projected_of_ellipsoidal_ographic_west) { + auto authFactory = + AuthorityFactory::create(DatabaseContext::create(), "IAU_2015"); + auto op = CoordinateOperationFactory::create()->createOperation( + authFactory->createCoordinateReferenceSystem("19902"), + authFactory->createCoordinateReferenceSystem("19911")); + ASSERT_TRUE(op != nullptr); + EXPECT_EQ(op->exportToPROJString(PROJStringFormatter::create().get()), + "+proj=pipeline " + "+step +proj=axisswap +order=2,1 " + "+step +proj=unitconvert +xy_in=deg +xy_out=rad " + "+step +inv +proj=geoc +a=2440530 +b=2438260 " + "+step +proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 " + "+a=2440530 +b=2438260 " + "+step +proj=axisswap +order=-1,2"); + + // Inverse + auto op2 = CoordinateOperationFactory::create()->createOperation( + authFactory->createCoordinateReferenceSystem("19911"), + authFactory->createCoordinateReferenceSystem("19902")); + ASSERT_TRUE(op2 != nullptr); + EXPECT_EQ(op2->exportToPROJString(PROJStringFormatter::create().get()), + "+proj=pipeline " + "+step +inv +proj=axisswap +order=-1,2 " + "+step +inv +proj=eqc +lat_ts=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 " + "+a=2440530 +b=2438260 " + "+step +proj=geoc +a=2440530 +b=2438260 " + "+step +proj=unitconvert +xy_in=rad +xy_out=deg " + "+step +proj=axisswap +order=2,1"); +} |
