diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-09-12 17:57:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-12 17:57:45 +0200 |
| commit | f2d44f3a2eacbdbf92212b9fe3c57549f4d30af4 (patch) | |
| tree | 5221d11da8de4d6254f81e40305a7c9c366cd1cd /test/unit | |
| parent | 947b4ae116e192a64cb9a1f752e88483223f9f28 (diff) | |
| parent | c87d0016e4c60f8c9cb2b909e114afccc51c7f23 (diff) | |
| download | PROJ-f2d44f3a2eacbdbf92212b9fe3c57549f4d30af4.tar.gz PROJ-f2d44f3a2eacbdbf92212b9fe3c57549f4d30af4.zip | |
Merge pull request #1607 from OSGeo/backport-1604-to-6.2
[Backport 6.2] proj_trans_generic(): properly set coordinate time to HUGE_VAL when no value is passed to the function
Diffstat (limited to 'test/unit')
| -rw-r--r-- | test/unit/gie_self_tests.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/unit/gie_self_tests.cpp b/test/unit/gie_self_tests.cpp index 399f51e5..15db814a 100644 --- a/test/unit/gie_self_tests.cpp +++ b/test/unit/gie_self_tests.cpp @@ -771,4 +771,30 @@ TEST(gie, proj_create_crs_to_crs_outside_area_of_use) { proj_destroy(P); } +// --------------------------------------------------------------------------- + +TEST(gie, proj_trans_generic) { + // GDA2020 to WGS84 (G1762) + auto P = proj_create( + PJ_DEFAULT_CTX, + "+proj=pipeline +step +proj=axisswap +order=2,1 " + "+step +proj=unitconvert +xy_in=deg +xy_out=rad " + "+step +proj=cart +ellps=GRS80 " + "+step +proj=helmert +x=0 +y=0 +z=0 +rx=0 +ry=0 +rz=0 +s=0 +dx=0 " + "+dy=0 +dz=0 +drx=-0.00150379 +dry=-0.00118346 +drz=-0.00120716 " + "+ds=0 +t_epoch=2020 +convention=coordinate_frame " + "+step +inv +proj=cart +ellps=WGS84 " + "+step +proj=unitconvert +xy_in=rad +xy_out=deg " + "+step +proj=axisswap +order=2,1"); + double lat = -60; + double lon = 120; + proj_trans_generic(P, PJ_FWD, &lat, sizeof(double), 1, &lon, sizeof(double), + 1, nullptr, 0, 0, nullptr, 0, 0); + // Should be a no-op when the time is unknown (or equal to 2020) + EXPECT_NEAR(lat, -60, 1e-9); + EXPECT_NEAR(lon, 120, 1e-9); + + proj_destroy(P); +} + } // namespace |
