diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-10-20 14:43:57 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-10-20 14:43:57 +0200 |
| commit | d18c1972dfe480847353c03a5c4aa259e7d1b482 (patch) | |
| tree | 716015174334f2e5b21308655b98953817044bb3 /test/unit/test_io.cpp | |
| parent | a8ca9b4b9f560dc6c1b49234844432d27d4b8000 (diff) | |
| download | PROJ-d18c1972dfe480847353c03a5c4aa259e7d1b482.tar.gz PROJ-d18c1972dfe480847353c03a5c4aa259e7d1b482.zip | |
Orthographic projection: do not add f=0 to PROJ string if the ellipsoid is a sphere (fixes GDAL PDS4 tests)
Diffstat (limited to 'test/unit/test_io.cpp')
| -rw-r--r-- | test/unit/test_io.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp index 47e574c5..1be0f2aa 100644 --- a/test/unit/test_io.cpp +++ b/test/unit/test_io.cpp @@ -9272,7 +9272,7 @@ TEST(io, projparse_ortho_ellipsoidal) { // --------------------------------------------------------------------------- -TEST(io, projparse_ortho_spherical) { +TEST(io, projparse_ortho_spherical_on_ellipsoid) { std::string input("+proj=ortho +f=0 +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 " "+ellps=WGS84 +units=m +no_defs +type=crs"); auto obj = PROJStringParser().createFromPROJString(input); @@ -9289,6 +9289,21 @@ TEST(io, projparse_ortho_spherical) { // --------------------------------------------------------------------------- +TEST(io, projparse_ortho_spherical_on_sphere) { + std::string input("+proj=ortho +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 " + "+R=6378137 +units=m +no_defs +type=crs"); + auto obj = PROJStringParser().createFromPROJString(input); + auto crs = nn_dynamic_pointer_cast<ProjectedCRS>(obj); + ASSERT_TRUE(crs != nullptr); + EXPECT_EQ( + crs->exportToPROJString( + PROJStringFormatter::create(PROJStringFormatter::Convention::PROJ_4) + .get()), + input); +} + +// --------------------------------------------------------------------------- + TEST(io, projparse_axisswap_unitconvert_longlat_proj) { std::string input = "+type=crs +proj=pipeline +step +proj=axisswap +order=2,1 +step " |
