diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-05-14 15:11:02 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-05-14 18:51:40 +0200 |
| commit | 11012ebcc910c4d95d5acbff43f444715ae1ad32 (patch) | |
| tree | 777757d7c6daf0e29900d4a49328a6cc78a7afbd /test/unit/test_io.cpp | |
| parent | 0c9cf39297a24d5e56aa488820a5ba3edaace90e (diff) | |
| download | PROJ-11012ebcc910c4d95d5acbff43f444715ae1ad32.tar.gz PROJ-11012ebcc910c4d95d5acbff43f444715ae1ad32.zip | |
WKT/PROJJSON parsing: fix BoundCRS/PROJ4_GRIDS handling for vertical component when vertical CRS has non metre unit (fixes #2217)
Diffstat (limited to 'test/unit/test_io.cpp')
| -rw-r--r-- | test/unit/test_io.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp index 0570bb7e..e57cb003 100644 --- a/test/unit/test_io.cpp +++ b/test/unit/test_io.cpp @@ -3442,6 +3442,32 @@ TEST(wkt_parse, WKT1_VERT_DATUM_EXTENSION) { // --------------------------------------------------------------------------- +TEST(wkt_parse, WKT1_VERT_DATUM_EXTENSION_units_ftUS) { + auto wkt = "VERT_CS[\"NAVD88 height (ftUS)\"," + " VERT_DATUM[\"North American Vertical Datum 1988\",2005," + " EXTENSION[\"PROJ4_GRIDS\",\"foo.gtx\"]," + " AUTHORITY[\"EPSG\",\"5103\"]]," + " UNIT[\"US survey foot\",0.304800609601219," + " AUTHORITY[\"EPSG\",\"9003\"]]," + " AXIS[\"Gravity-related height\",UP]," + " AUTHORITY[\"EPSG\",\"6360\"]]"; + + auto obj = WKTParser().createFromWKT(wkt); + auto crs = nn_dynamic_pointer_cast<BoundCRS>(obj); + ASSERT_TRUE(crs != nullptr); + + EXPECT_EQ(crs->transformation()->nameStr(), + "NAVD88 height to WGS84 ellipsoidal height"); // no (ftUS) + auto sourceTransformationCRS = crs->transformation()->sourceCRS(); + auto sourceTransformationVertCRS = + nn_dynamic_pointer_cast<VerticalCRS>(sourceTransformationCRS); + EXPECT_EQ( + sourceTransformationVertCRS->coordinateSystem()->axisList()[0]->unit(), + UnitOfMeasure::METRE); +} + +// --------------------------------------------------------------------------- + TEST(wkt_parse, WKT1_DATUM_EXTENSION) { auto wkt = "PROJCS[\"unnamed\",\n" |
