diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-03-25 11:44:05 +0000 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-03-25 12:05:40 +0000 |
| commit | 78fc3263edb399e32f62f06b68dcaf6191fd515f (patch) | |
| tree | ba3d8b5ee32dcfa46cc3fe7403e11fca0718788e /test/unit/test_io.cpp | |
| parent | 6b99f76ccd422691fd2618535256818a4df719a4 (diff) | |
| download | PROJ-78fc3263edb399e32f62f06b68dcaf6191fd515f.tar.gz PROJ-78fc3263edb399e32f62f06b68dcaf6191fd515f.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; + } } // --------------------------------------------------------------------------- |
