From 6351422cc2108072162f7b8cdff12916723ccc20 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 23 Oct 2020 00:03:04 +0200 Subject: WKT1_ESRI export: try to export Geographic3D and Projected3D CRS when we can find a corresponding ellipsoidal vertical datum --- test/unit/test_io.cpp | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'test/unit/test_io.cpp') diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp index 93b79b67..555d1159 100644 --- a/test/unit/test_io.cpp +++ b/test/unit/test_io.cpp @@ -2764,7 +2764,7 @@ TEST(wkt_parse, VERTCS_with_ellipsoidal_height_ESRI) { // --------------------------------------------------------------------------- -TEST(wkt_parse, implicit_compound_CRS_with_ellipsoidal_height_ESRI) { +TEST(wkt_parse, implicit_compound_CRS_geographic_with_ellipsoidal_height_ESRI) { const char *wkt = "GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\"," "SPHEROID[\"WGS_1984\",6378137.0,298.257223563]]," @@ -2778,6 +2778,45 @@ TEST(wkt_parse, implicit_compound_CRS_with_ellipsoidal_height_ESRI) { auto crs = nn_dynamic_pointer_cast(obj); ASSERT_TRUE(crs != nullptr); EXPECT_EQ(crs->coordinateSystem()->axisList().size(), 3U); + + EXPECT_EQ( + crs->exportToWKT( + WKTFormatter::create(WKTFormatter::Convention::WKT1_ESRI, dbContext) + .get()), + wkt); +} + +// --------------------------------------------------------------------------- + +TEST(wkt_parse, implicit_compound_CRS_projected_with_ellipsoidal_height_ESRI) { + const char *wkt = + "PROJCS[\"WGS_1984_UTM_Zone_31N\",GEOGCS[\"GCS_WGS_1984\"," + "DATUM[\"D_WGS_1984\"," + "SPHEROID[\"WGS_1984\",6378137.0,298.257223563]]," + "PRIMEM[\"Greenwich\",0.0],UNIT[\"Degree\",0.0174532925199433]]," + "PROJECTION[\"Transverse_Mercator\"]," + "PARAMETER[\"False_Easting\",500000.0]," + "PARAMETER[\"False_Northing\",0.0]," + "PARAMETER[\"Central_Meridian\",3.0]," + "PARAMETER[\"Scale_Factor\",0.9996]," + "PARAMETER[\"Latitude_Of_Origin\",0.0]," + "UNIT[\"Meter\",1.0]]," + "VERTCS[\"WGS_1984\"," + "DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]]," + "PARAMETER[\"Vertical_Shift\",0.0]," + "PARAMETER[\"Direction\",1.0]," + "UNIT[\"Meter\",1.0]]"; + auto dbContext = DatabaseContext::create(); + auto obj = WKTParser().attachDatabaseContext(dbContext).createFromWKT(wkt); + auto crs = nn_dynamic_pointer_cast(obj); + ASSERT_TRUE(crs != nullptr); + EXPECT_EQ(crs->coordinateSystem()->axisList().size(), 3U); + + EXPECT_EQ( + crs->exportToWKT( + WKTFormatter::create(WKTFormatter::Convention::WKT1_ESRI, dbContext) + .get()), + wkt); } // --------------------------------------------------------------------------- -- cgit v1.2.3