diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-09-13 02:28:24 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-09-13 02:28:24 +0200 |
| commit | e1fabf92fca6af58b2716f97c2ebe884000c07f5 (patch) | |
| tree | 79df11379a2d4279d5fe67ff3cc957691d991e0f /test | |
| parent | 1d1c7443fdd5425c878ccc75452561da73a8688a (diff) | |
| download | PROJ-e1fabf92fca6af58b2716f97c2ebe884000c07f5.tar.gz PROJ-e1fabf92fca6af58b2716f97c2ebe884000c07f5.zip | |
Fix support for +proj=ob_tran +o_proj=lonlat/latlong/latlon (only +o_proj=longlat worked) (fixes #1601)
Diffstat (limited to 'test')
| -rw-r--r-- | test/unit/test_io.cpp | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp index 85f3e06a..872038fc 100644 --- a/test/unit/test_io.cpp +++ b/test/unit/test_io.cpp @@ -8540,23 +8540,32 @@ TEST(io, projparse_projected_wktext) { // --------------------------------------------------------------------------- TEST(io, projparse_ob_tran_longlat) { - std::string input( - "+type=crs +proj=pipeline +step +proj=axisswap +order=2,1 +step " - "+proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=ob_tran " - "+o_proj=longlat +o_lat_p=52 +o_lon_p=-30 +lon_0=-25 +ellps=WGS84 " - "+step +proj=axisswap +order=2,1"); - auto obj = PROJStringParser().createFromPROJString(input); - auto crs = nn_dynamic_pointer_cast<DerivedGeographicCRS>(obj); - ASSERT_TRUE(crs != nullptr); - auto op = CoordinateOperationFactory::create()->createOperation( - GeographicCRS::EPSG_4326, NN_NO_CHECK(crs)); - ASSERT_TRUE(op != nullptr); - EXPECT_EQ(op->exportToPROJString(PROJStringFormatter::create().get()), - "+proj=pipeline +step +proj=axisswap +order=2,1 +step " - "+proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=ob_tran " - "+o_proj=longlat +o_lat_p=52 +o_lon_p=-30 +lon_0=-25 " - "+ellps=WGS84 +step +proj=unitconvert +xy_in=rad +xy_out=deg " - "+step +proj=axisswap +order=2,1"); + for (const char *o_proj : {"longlat", "lonlat", "latlong", "latlon"}) { + std::string input( + "+type=crs +proj=pipeline +step +proj=axisswap +order=2,1 +step " + "+proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=ob_tran " + "+o_proj="); + input += o_proj; + input += " +o_lat_p=52 +o_lon_p=-30 +lon_0=-25 +ellps=WGS84 " + "+step +proj=axisswap +order=2,1"; + auto obj = PROJStringParser().createFromPROJString(input); + auto crs = nn_dynamic_pointer_cast<DerivedGeographicCRS>(obj); + ASSERT_TRUE(crs != nullptr); + auto op = CoordinateOperationFactory::create()->createOperation( + GeographicCRS::EPSG_4326, NN_NO_CHECK(crs)); + ASSERT_TRUE(op != nullptr); + std::string expected( + "+proj=pipeline +step +proj=axisswap +order=2,1 +step " + "+proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=ob_tran " + "+o_proj="); + expected += o_proj; + expected += + " +o_lat_p=52 +o_lon_p=-30 +lon_0=-25 " + "+ellps=WGS84 +step +proj=unitconvert +xy_in=rad +xy_out=deg " + "+step +proj=axisswap +order=2,1"; + EXPECT_EQ(op->exportToPROJString(PROJStringFormatter::create().get()), + expected); + } } // --------------------------------------------------------------------------- |
