aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-10-23 00:03:04 +0200
committerEven Rouault <even.rouault@spatialys.com>2020-10-23 00:03:40 +0200
commit6351422cc2108072162f7b8cdff12916723ccc20 (patch)
tree9394fb47beeb183279d30faba6d531035e596f0a /test
parent4969076c15f73371401ee65f2e4617439239cd8b (diff)
downloadPROJ-6351422cc2108072162f7b8cdff12916723ccc20.tar.gz
PROJ-6351422cc2108072162f7b8cdff12916723ccc20.zip
WKT1_ESRI export: try to export Geographic3D and Projected3D CRS when we can find a corresponding ellipsoidal vertical datum
Diffstat (limited to 'test')
-rw-r--r--test/unit/test_io.cpp41
1 files changed, 40 insertions, 1 deletions
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<GeographicCRS>(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<ProjectedCRS>(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);
}
// ---------------------------------------------------------------------------