diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-03-25 12:07:35 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-03-25 12:44:35 +0100 |
| commit | d4fd50f10ecabb9e9642cb4f877262e082677be4 (patch) | |
| tree | facc35a7cf88385ec6fe2ac2c7d43997ff56d894 /test/unit/test_io.cpp | |
| parent | 72f0e8a895a861e4323cac61b73f807c8a5f1c0d (diff) | |
| download | PROJ-d4fd50f10ecabb9e9642cb4f877262e082677be4.tar.gz PROJ-d4fd50f10ecabb9e9642cb4f877262e082677be4.zip | |
WKT2_2018: export ID in base crs node, when there is none on top of upper node
This is the standard logic, that is now possible since ID is
allowed in BASEGEOGCRS and similar node
Diffstat (limited to 'test/unit/test_io.cpp')
| -rw-r--r-- | test/unit/test_io.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp index 1d097d9b..2181b321 100644 --- a/test/unit/test_io.cpp +++ b/test/unit/test_io.cpp @@ -1667,6 +1667,35 @@ TEST(wkt_parse, wkt2_2018_projected_with_id_in_basegeodcrs) { // --------------------------------------------------------------------------- +TEST(wkt_parse, wkt2_2018_projected_no_id_but_id_in_basegeodcrs) { + auto wkt = "PROJCRS[\"WGS 84 / UTM zone 31N\",\n" + " BASEGEOGCRS[\"WGS 84\",\n" + " DATUM[\"World Geodetic System 1984\",\n" + " ELLIPSOID[\"WGS 84\",6378137,298.257223563]],\n" + " ID[\"EPSG\",4326]],\n" + " CONVERSION[\"UTM zone 31N\",\n" + " METHOD[\"Transverse Mercator\"],\n" + " PARAMETER[\"Latitude of natural origin\",0],\n" + " PARAMETER[\"Longitude of natural origin\",3],\n" + " PARAMETER[\"Scale factor at natural origin\",0.9996],\n" + " PARAMETER[\"False easting\",500000],\n" + " PARAMETER[\"False northing\",0]],\n" + " CS[Cartesian,2],\n" + " AXIS[\"(E)\",east],\n" + " AXIS[\"(N)\",north],\n" + " UNIT[\"metre\",1]]"; + auto obj = WKTParser().createFromWKT(wkt); + auto crs = nn_dynamic_pointer_cast<ProjectedCRS>(obj); + ASSERT_TRUE(crs != nullptr); + + 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; +} + +// --------------------------------------------------------------------------- + TEST(wkt_parse, wkt2_2018_simplified_projected) { auto wkt = "PROJCRS[\"WGS 84 / UTM zone 31N\",\n" " BASEGEOGCRS[\"WGS 84\",\n" |
