diff options
| author | Kristian Evers <kristianevers@gmail.com> | 2019-03-19 14:03:04 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-19 14:03:04 +0100 |
| commit | 42b9332f70859e5f428901cd801c2a4064373373 (patch) | |
| tree | 3b745d508525d66ff282a8992c843bd06b9ea491 /test | |
| parent | c5cc0f74fd912cef2872da227fa2bb2b47f116c6 (diff) | |
| parent | 1b8b720bb742a50815b70f2025d9e1d5378899b2 (diff) | |
| download | PROJ-42b9332f70859e5f428901cd801c2a4064373373.tar.gz PROJ-42b9332f70859e5f428901cd801c2a4064373373.zip | |
Merge pull request #1333 from rouault/fix_1329
proj_create_crs_to_crs: better deal with coordinates outside of bbox (fixes #1329)
Diffstat (limited to 'test')
| -rw-r--r-- | test/unit/gie_self_tests.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/unit/gie_self_tests.cpp b/test/unit/gie_self_tests.cpp index 3f99b1b3..399f51e5 100644 --- a/test/unit/gie_self_tests.cpp +++ b/test/unit/gie_self_tests.cpp @@ -748,4 +748,27 @@ TEST(gie, proj_create_crs_to_crs_PULKOVO42_ETRS89) { proj_destroy(P); } +// --------------------------------------------------------------------------- + +TEST(gie, proj_create_crs_to_crs_outside_area_of_use) { + + // See https://github.com/OSGeo/proj.4/issues/1329 + auto P = proj_create_crs_to_crs(PJ_DEFAULT_CTX, "EPSG:4275", "EPSG:4807", + nullptr); + ASSERT_TRUE(P != nullptr); + PJ_COORD c; + + EXPECT_EQ(P->fwd, nullptr); + + // Test point outside area of use of both candidate coordinate operations + c.xyz.x = 58; // Lat in deg + c.xyz.y = 5; // Long in deg + c.xyz.z = 0; + c = proj_trans(P, PJ_FWD, c); + EXPECT_NEAR(c.xy.x, 64.44444444444444, 1e-9); // Lat in grad + EXPECT_NEAR(c.xy.y, 2.958634259259258, 1e-9); // Long in grad + + proj_destroy(P); +} + } // namespace |
