diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-01-04 19:25:04 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-01-04 19:25:04 +0100 |
| commit | b62fdee0f34d960527af8fb0a8bf6344fcf78d4b (patch) | |
| tree | 0341b02ba45f0a3d1761adde97d3c58a220e73ac /test/unit/test_crs.cpp | |
| parent | d89a6ab2f3f26d1451971369b0ccfc4eb322729d (diff) | |
| download | PROJ-b62fdee0f34d960527af8fb0a8bf6344fcf78d4b.tar.gz PROJ-b62fdee0f34d960527af8fb0a8bf6344fcf78d4b.zip | |
WKT export: no longer export Geographic 3D CRS in WKT1, unless strict mode is disabled
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); } // --------------------------------------------------------------------------- |
