diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-03-25 10:41:29 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-03-25 15:15:29 +0100 |
| commit | fbc654ab0c3dc6d707bdee226121275736c2bfb5 (patch) | |
| tree | 47b8ee6d2c0656b7187206f7599943f17b305f4a /test/unit | |
| parent | 23d2941ef30f5fa62230606766ae8b9e296f814f (diff) | |
| download | PROJ-fbc654ab0c3dc6d707bdee226121275736c2bfb5.tar.gz PROJ-fbc654ab0c3dc6d707bdee226121275736c2bfb5.zip | |
EngineeringCRS: when exporting to WKT1_GDAL, output unit and axis (fixes https://github.com/OSGeo/gdal/issues/2347)
Diffstat (limited to 'test/unit')
| -rw-r--r-- | test/unit/test_c_api.cpp | 7 | ||||
| -rw-r--r-- | test/unit/test_crs.cpp | 9 | ||||
| -rw-r--r-- | test/unit/test_io.cpp | 7 |
3 files changed, 19 insertions, 4 deletions
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp index 610d7cde..da95e523 100644 --- a/test/unit/test_c_api.cpp +++ b/test/unit/test_c_api.cpp @@ -2797,7 +2797,12 @@ TEST_F(CApi, proj_create_engineering_crs) { ASSERT_NE(crs, nullptr); auto wkt = proj_as_wkt(m_ctxt, crs, PJ_WKT1_GDAL, nullptr); ASSERT_NE(wkt, nullptr); - EXPECT_EQ(std::string(wkt), "LOCAL_CS[\"name\"]") << wkt; + EXPECT_EQ(std::string(wkt), "LOCAL_CS[\"name\",\n" + " UNIT[\"metre\",1,\n" + " AUTHORITY[\"EPSG\",\"9001\"]],\n" + " AXIS[\"Easting\",EAST],\n" + " AXIS[\"Northing\",NORTH]]") + << wkt; } // --------------------------------------------------------------------------- diff --git a/test/unit/test_crs.cpp b/test/unit/test_crs.cpp index 13ddc587..4a4c0511 100644 --- a/test/unit/test_crs.cpp +++ b/test/unit/test_crs.cpp @@ -4903,7 +4903,11 @@ TEST(crs, engineeringCRS_WKT2) { TEST(crs, engineeringCRS_WKT1) { auto expected = "LOCAL_CS[\"Engineering CRS\",\n" - " LOCAL_DATUM[\"Engineering datum\",32767]]"; + " LOCAL_DATUM[\"Engineering datum\",32767],\n" + " UNIT[\"metre\",1,\n" + " AUTHORITY[\"EPSG\",\"9001\"]],\n" + " AXIS[\"Easting\",EAST],\n" + " AXIS[\"Northing\",NORTH]]"; EXPECT_EQ( createEngineeringCRS()->exportToWKT( WKTFormatter::create(WKTFormatter::Convention::WKT1_GDAL).get()), @@ -5489,7 +5493,8 @@ TEST(crs, crs_alterCSLinearUnit) { auto wkt = alteredCRS->exportToWKT( &(WKTFormatter::create(WKTFormatter::Convention::WKT1_GDAL) ->setMultiLine(false))); - EXPECT_EQ(wkt, "LOCAL_CS[\"foo\",UNIT[\"my unit\",2]]"); + EXPECT_EQ(wkt, "LOCAL_CS[\"foo\",UNIT[\"my unit\",2]," + "AXIS[\"Easting\",EAST],AXIS[\"Northing\",NORTH]]"); } { diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp index 8a2d1ad7..9d6c2c43 100644 --- a/test/unit/test_io.cpp +++ b/test/unit/test_io.cpp @@ -3936,10 +3936,15 @@ TEST(wkt_parse, LOCAL_CS_short) { auto cs = crs->coordinateSystem(); ASSERT_EQ(cs->axisList().size(), 2U); + auto expected_wkt = "LOCAL_CS[\"Engineering CRS\",\n" + " UNIT[\"metre\",1,\n" + " AUTHORITY[\"EPSG\",\"9001\"]],\n" + " AXIS[\"Easting\",EAST],\n" + " AXIS[\"Northing\",NORTH]]"; EXPECT_EQ( crs->exportToWKT( WKTFormatter::create(WKTFormatter::Convention::WKT1_GDAL).get()), - wkt); + expected_wkt); } // --------------------------------------------------------------------------- |
