diff options
Diffstat (limited to 'test/unit/test_c_api.cpp')
| -rw-r--r-- | test/unit/test_c_api.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index f87f6589..22e2ac11 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -3486,6 +3486,36 @@ TEST_F(CApi, proj_normalize_for_visualization_on_crs) { // --------------------------------------------------------------------------- +TEST_F(CApi, proj_coordoperation_create_inverse) { + + auto P = proj_create( + m_ctxt, "+proj=pipeline +step +proj=axisswap +order=2,1 +step " + "+proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=push " + "+v_3 +step +proj=cart +ellps=evrst30 +step +proj=helmert " + "+x=293 +y=836 +z=318 +rx=0.5 +ry=1.6 +rz=-2.8 +s=2.1 " + "+convention=position_vector +step +inv +proj=cart " + "+ellps=WGS84 +step +proj=pop +v_3 +step +proj=unitconvert " + "+xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1"); + ObjectKeeper keeper_P(P); + ASSERT_NE(P, nullptr); + auto Pinversed = proj_coordoperation_create_inverse(m_ctxt, P); + ObjectKeeper keeper_Pinversed(Pinversed); + ASSERT_NE(Pinversed, nullptr); + + auto projstr = proj_as_proj_string(m_ctxt, Pinversed, PJ_PROJ_5, nullptr); + ASSERT_NE(projstr, nullptr); + EXPECT_EQ(std::string(projstr), + "+proj=pipeline +step +proj=axisswap +order=2,1 +step " + "+proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=push +v_3 " + "+step +proj=cart +ellps=WGS84 +step +inv +proj=helmert +x=293 " + "+y=836 +z=318 +rx=0.5 +ry=1.6 +rz=-2.8 +s=2.1 " + "+convention=position_vector +step +inv +proj=cart " + "+ellps=evrst30 +step +proj=pop +v_3 +step +proj=unitconvert " + "+xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1"); +} + +// --------------------------------------------------------------------------- + TEST_F(CApi, proj_get_remarks) { auto co = proj_create_from_database(m_ctxt, "EPSG", "8048", PJ_CATEGORY_COORDINATE_OPERATION, false, |
