aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_crs.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2018-12-04 16:51:55 +0100
committerEven Rouault <even.rouault@spatialys.com>2018-12-04 17:05:33 +0100
commit8869f7036efb879620a7e42f9c159a5bb07511cb (patch)
tree356c1ced4422cdc1a6f3fe8ba14f12a666fc8c7a /test/unit/test_crs.cpp
parent85c32717ef2c804031e09eda70ed6bd83ae164b7 (diff)
downloadPROJ-8869f7036efb879620a7e42f9c159a5bb07511cb.tar.gz
PROJ-8869f7036efb879620a7e42f9c159a5bb07511cb.zip
export to WKT1 of geocentric CRS: do not emit a TOWGS84 node if the datum is WGS84
Diffstat (limited to 'test/unit/test_crs.cpp')
-rw-r--r--test/unit/test_crs.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/unit/test_crs.cpp b/test/unit/test_crs.cpp
index 3f044de0..e0505fea 100644
--- a/test/unit/test_crs.cpp
+++ b/test/unit/test_crs.cpp
@@ -1115,6 +1115,29 @@ TEST(crs, geocentricCRS_as_WKT1_GDAL) {
// ---------------------------------------------------------------------------
+TEST(crs, EPSG_4978_as_WKT1_GDAL_with_database) {
+ auto crs = GeodeticCRS::EPSG_4978;
+ auto wkt = crs->exportToWKT(
+ WKTFormatter::create(WKTFormatter::Convention::WKT1_GDAL,
+ DatabaseContext::create())
+ .get());
+ EXPECT_EQ(wkt, "GEOCCS[\"WGS 84\",\n"
+ " DATUM[\"WGS_1984\",\n"
+ " SPHEROID[\"WGS 84\",6378137,298.257223563,\n"
+ " AUTHORITY[\"EPSG\",\"7030\"]],\n"
+ " AUTHORITY[\"EPSG\",\"6326\"]],\n"
+ " PRIMEM[\"Greenwich\",0,\n"
+ " AUTHORITY[\"EPSG\",\"8901\"]],\n"
+ " UNIT[\"metre\",1,\n"
+ " AUTHORITY[\"EPSG\",\"9001\"]],\n"
+ " AXIS[\"Geocentric X\",OTHER],\n"
+ " AXIS[\"Geocentric Y\",OTHER],\n"
+ " AXIS[\"Geocentric Z\",NORTH],\n"
+ " AUTHORITY[\"EPSG\",\"4978\"]]");
+}
+
+// ---------------------------------------------------------------------------
+
TEST(crs, geocentricCRS_as_PROJ_string) {
auto crs = createGeocentric();
EXPECT_EQ(crs->exportToPROJString(PROJStringFormatter::create().get()),