diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-03-25 12:44:05 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-03-25 13:05:40 +0100 |
| commit | 46f08f1434f66a4160d7c74923efcfb81505b398 (patch) | |
| tree | 680c623c5eee0978cf03e2f6475995d1e8cd52d0 /test/unit/test_io.cpp | |
| parent | d4fd50f10ecabb9e9642cb4f877262e082677be4 (diff) | |
| download | PROJ-46f08f1434f66a4160d7c74923efcfb81505b398.tar.gz PROJ-46f08f1434f66a4160d7c74923efcfb81505b398.zip | |
WKT2_2018: always export ID in base crs node, even if there is one on upper node
This is a particular logic allowed by paragraph 7.3.3 Identifier
of OGC 18-010r6
Diffstat (limited to 'test/unit/test_io.cpp')
| -rw-r--r-- | test/unit/test_io.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp index 2181b321..17b3c334 100644 --- a/test/unit/test_io.cpp +++ b/test/unit/test_io.cpp @@ -1663,6 +1663,21 @@ TEST(wkt_parse, wkt2_2018_projected_with_id_in_basegeodcrs) { ASSERT_TRUE(crs != nullptr); ASSERT_EQ(crs->baseCRS()->identifiers().size(), 1U); EXPECT_EQ(crs->baseCRS()->identifiers().front()->code(), "4326"); + + { + auto got_wkt = crs->exportToWKT( + WKTFormatter::create(WKTFormatter::Convention::WKT2_2018).get()); + EXPECT_TRUE(got_wkt.find("ID[\"EPSG\",4326]]") != std::string::npos) + << got_wkt; + } + + { + auto got_wkt = crs->exportToWKT( + WKTFormatter::create(WKTFormatter::Convention::WKT2_2018_SIMPLIFIED) + .get()); + EXPECT_TRUE(got_wkt.find("ID[\"EPSG\",4326]]") == std::string::npos) + << got_wkt; + } } // --------------------------------------------------------------------------- |
