diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-01-05 19:56:03 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-01-05 19:56:03 +0100 |
| commit | 0fbe7cf33c308c4b7c81e65e18b90e9d773ba333 (patch) | |
| tree | e0bdd52d3ebb96edd97df9a8e385fc9af6dd15c2 /test/unit/test_crs.cpp | |
| parent | 3ea468222fdabdae3aa5b47439d6b3bfb0a93c8e (diff) | |
| parent | b62fdee0f34d960527af8fb0a8bf6344fcf78d4b (diff) | |
| download | PROJ-0fbe7cf33c308c4b7c81e65e18b90e9d773ba333.tar.gz PROJ-0fbe7cf33c308c4b7c81e65e18b90e9d773ba333.zip | |
Merge remote-tracking branch 'rouault/gdalbarn'
Diffstat (limited to 'test/unit/test_crs.cpp')
| -rw-r--r-- | test/unit/test_crs.cpp | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/test/unit/test_crs.cpp b/test/unit/test_crs.cpp index 6eb0602e..fe0ac7e8 100644 --- a/test/unit/test_crs.cpp +++ b/test/unit/test_crs.cpp @@ -442,14 +442,16 @@ TEST(crs, EPSG_4979_as_WKT2_2018_SIMPLIFIED) { // --------------------------------------------------------------------------- -TEST(crs, EPSG_4979_as_WKT1_GDAL_with_axis) { +TEST(crs, EPSG_4979_as_WKT1_GDAL_with_axis_not_strict_mode) { auto crs = GeographicCRS::EPSG_4979; auto wkt = crs->exportToWKT( &(WKTFormatter::create(WKTFormatter::Convention::WKT1_GDAL) - ->setOutputAxis(WKTFormatter::OutputAxisRule::YES))); + ->setStrict(false) + .setOutputAxis(WKTFormatter::OutputAxisRule::YES))); // WKT1 only supports 2 axis for GEOGCS. So this is an extension of // WKT1 as it // and GDAL doesn't really export such as beast, although it can import it + // so allow it only in non-strict more EXPECT_EQ(wkt, "GEOGCS[\"WGS 84\",\n" " DATUM[\"WGS_1984\",\n" " SPHEROID[\"WGS 84\",6378137,298.257223563,\n" @@ -469,18 +471,10 @@ TEST(crs, EPSG_4979_as_WKT1_GDAL_with_axis) { TEST(crs, EPSG_4979_as_WKT1_GDAL) { auto crs = GeographicCRS::EPSG_4979; - auto wkt = crs->exportToWKT( - WKTFormatter::create(WKTFormatter::Convention::WKT1_GDAL).get()); - EXPECT_EQ(wkt, "GEOGCS[\"WGS 84\",\n" - " DATUM[\"WGS_1984\",\n" - " SPHEROID[\"WGS 84\",6378137,298.257223563,\n" - " AUTHORITY[\"EPSG\",\"7030\"]],\n" - " AUTHORITY[\"EPSG\",\"6326\"]],\n" - " PRIMEM[\"Greenwich\",0,\n" - " AUTHORITY[\"EPSG\",\"8901\"]],\n" - " UNIT[\"degree\",0.0174532925199433,\n" - " AUTHORITY[\"EPSG\",\"9122\"]],\n" - " AUTHORITY[\"EPSG\",\"4979\"]]"); + EXPECT_THROW( + crs->exportToWKT( + WKTFormatter::create(WKTFormatter::Convention::WKT1_GDAL).get()), + FormattingException); } // --------------------------------------------------------------------------- |
