aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-03-25 17:55:46 +0100
committerGitHub <noreply@github.com>2020-03-25 17:55:46 +0100
commitb3fe4a04edd2fb141b2faf4c4cb9bc24b430849d (patch)
tree43e67a483c7e5bd7577a34a35dea545328195484 /test
parent60ed38a2483cf6fe44f2fdf7b75844c9fff2c92c (diff)
parent2eb726f0e169c41cb9881dd49cb172e8e34325e8 (diff)
downloadPROJ-b3fe4a04edd2fb141b2faf4c4cb9bc24b430849d.tar.gz
PROJ-b3fe4a04edd2fb141b2faf4c4cb9bc24b430849d.zip
Merge pull request #2091 from PROJ-BOT/backport-2090-to-6.3
[Backport 6.3] EngineeringCRS: when exporting to WKT1_GDAL, output unit and axis (fixes https://github.com/OSGeo/gdal/issues/2347)
Diffstat (limited to 'test')
-rw-r--r--test/unit/test_c_api.cpp7
-rw-r--r--test/unit/test_crs.cpp9
-rw-r--r--test/unit/test_io.cpp7
3 files changed, 19 insertions, 4 deletions
diff --git a/test/unit/test_c_api.cpp b/test/unit/test_c_api.cpp
index 050ffdb8..b53223d7 100644
--- a/test/unit/test_c_api.cpp
+++ b/test/unit/test_c_api.cpp
@@ -2738,7 +2738,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 c5ea1acc..e5a974bf 100644
--- a/test/unit/test_crs.cpp
+++ b/test/unit/test_crs.cpp
@@ -4813,7 +4813,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()),
@@ -5399,7 +5403,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 399cea8c..92bc6d4b 100644
--- a/test/unit/test_io.cpp
+++ b/test/unit/test_io.cpp
@@ -3901,10 +3901,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);
}
// ---------------------------------------------------------------------------