diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-09-26 17:34:21 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-26 17:34:21 +0200 |
| commit | b0b21db45f0dc32c33e1e6c45ab1fe5cc1a4f3df (patch) | |
| tree | 7f493eaac0739bc10c335f35e191fcc93e9bc8af /test/unit/test_c_api.cpp | |
| parent | 36fb1cb5d74181475cbab9d01834059673d629f8 (diff) | |
| parent | 668d882938b3e907bc3738df770f903843bf8578 (diff) | |
| download | PROJ-b0b21db45f0dc32c33e1e6c45ab1fe5cc1a4f3df.tar.gz PROJ-b0b21db45f0dc32c33e1e6c45ab1fe5cc1a4f3df.zip | |
Merge pull request #1643 from rouault/backport-1641-to-6.2
[Backport 6.2] proj_create_crs_to_crs(): fix when there are only transformations with ballpark steps
Diffstat (limited to 'test/unit/test_c_api.cpp')
| -rw-r--r-- | test/unit/test_c_api.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index db4b768b..aa1c2ad7 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -3811,4 +3811,30 @@ TEST_F(CApi, proj_crs_create_projected_3D_crs_from_2D) { } } +// --------------------------------------------------------------------------- + +TEST_F(CApi, proj_create_crs_to_crs_with_only_ballpark_transformations) { + // ETRS89 / UTM zone 31N + EGM96 height to WGS 84 (G1762) + auto P = + proj_create_crs_to_crs(m_ctxt, "EPSG:25831+5773", "EPSG:7665", nullptr); + ObjectKeeper keeper_P(P); + ASSERT_NE(P, nullptr); + auto Pnormalized = proj_normalize_for_visualization(m_ctxt, P); + ObjectKeeper keeper_Pnormalized(Pnormalized); + ASSERT_NE(Pnormalized, nullptr); + + PJ_COORD coord; + coord.xyzt.x = 500000; + coord.xyzt.y = 4500000; + coord.xyzt.z = 0; + coord.xyzt.t = 0; + coord = proj_trans(Pnormalized, PJ_FWD, coord); + EXPECT_NEAR(coord.xyzt.x, 3.0, 1e-9); + EXPECT_NEAR(coord.xyzt.y, 40.65085651660555, 1e-9); + if (coord.xyzt.z != 0) { + // z will depend if the egm96_15.gtx grid is there or not + EXPECT_NEAR(coord.xyzt.z, 47.04784081844435, 1e-3); + } +} + } // namespace |
