diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-04-24 15:22:02 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2021-04-24 15:51:19 +0200 |
| commit | 7898eaba1160631405e8d4eccd73254f453bd3d4 (patch) | |
| tree | 7d796b52ce2ca6ffa6ca3d584fecdab4d70965e0 /test/unit/test_io.cpp | |
| parent | 01a5c03c052be14f731b1e96ca3c0005f110aad8 (diff) | |
| download | PROJ-7898eaba1160631405e8d4eccd73254f453bd3d4.tar.gz PROJ-7898eaba1160631405e8d4eccd73254f453bd3d4.zip | |
Improvements related to DerivedVerticalCRS using Change Unit and Height/Depth reversal methods
- For instantiation from urn combined references, create a better name,
using conventions of EPSG vertical CRS
- For exportToWKT(), allow export in WKT < WKT2 for such
DerivedVerticalCRS
Diffstat (limited to 'test/unit/test_io.cpp')
| -rw-r--r-- | test/unit/test_io.cpp | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp index 97cdca11..7775416f 100644 --- a/test/unit/test_io.cpp +++ b/test/unit/test_io.cpp @@ -10585,6 +10585,7 @@ TEST(io, createFromUserInput) { EXPECT_EQ(crs->coordinateSystem()->getEPSGCode(), 4400); EXPECT_EQ(crs->derivingConversion()->getEPSGCode(), 16031); } + { // DerivedVerticalCRS based on "NAVD88 height", using a foot UP axis, // and EPSG:7813 "Vertical Axis Unit Conversion" conversion @@ -10594,12 +10595,72 @@ TEST(io, createFromUserInput) { dbContext); auto crs = nn_dynamic_pointer_cast<DerivedVerticalCRS>(obj); ASSERT_TRUE(crs != nullptr); + EXPECT_EQ(crs->nameStr(), "NAVD88 height (ft)"); EXPECT_EQ(crs->baseCRS()->getEPSGCode(), 5703); EXPECT_EQ(crs->coordinateSystem()->getEPSGCode(), 1030); EXPECT_EQ(crs->derivingConversion()->getEPSGCode(), 7813); } { + // DerivedVerticalCRS based on "NAVD88 height", using a ftUS UP axis, + // and EPSG:7813 "Vertical Axis Unit Conversion" conversion + auto obj = createFromUserInput("urn:ogc:def:crs,crs:EPSG::5703," + "cs:EPSG::6497," + "coordinateOperation:EPSG::7813", + dbContext); + auto crs = nn_dynamic_pointer_cast<DerivedVerticalCRS>(obj); + ASSERT_TRUE(crs != nullptr); + EXPECT_EQ(crs->nameStr(), "NAVD88 height (ftUS)"); + } + + { + // DerivedVerticalCRS based on "NAVD88 height (ftUS)", using a metre UP + // axis, and EPSG:7813 "Vertical Axis Unit Conversion" conversion + auto obj = createFromUserInput("urn:ogc:def:crs,crs:EPSG::6360," + "cs:EPSG::6499," + "coordinateOperation:EPSG::7813", + dbContext); + auto crs = nn_dynamic_pointer_cast<DerivedVerticalCRS>(obj); + ASSERT_TRUE(crs != nullptr); + EXPECT_EQ(crs->nameStr(), "NAVD88 height"); + } + { + // DerivedVerticalCRS based on "NAVD88 height", using a metre DOWN axis, + // and EPSG:7812 "Height / Depth reversal" conversion + auto obj = createFromUserInput("urn:ogc:def:crs,crs:EPSG::5703," + "cs:EPSG::6498," + "coordinateOperation:EPSG::7812", + dbContext); + auto crs = nn_dynamic_pointer_cast<DerivedVerticalCRS>(obj); + ASSERT_TRUE(crs != nullptr); + EXPECT_EQ(crs->nameStr(), "NAVD88 depth"); + } + + { + // DerivedVerticalCRS based on "NAVD88 height (ftUS)", using a ftUS DOWN + // axis, and EPSG:7812 "Height / Depth reversal" conversion + auto obj = createFromUserInput("urn:ogc:def:crs,crs:EPSG::6360," + "cs:EPSG::1043," + "coordinateOperation:EPSG::7812", + dbContext); + auto crs = nn_dynamic_pointer_cast<DerivedVerticalCRS>(obj); + ASSERT_TRUE(crs != nullptr); + EXPECT_EQ(crs->nameStr(), "NAVD88 depth (ftUS)"); + } + + { + // DerivedVerticalCRS based on "NAVD88 depth (ftUS)", using a ftUS UP + // axis, and EPSG:7812 "Height / Depth reversal" conversion + auto obj = createFromUserInput("urn:ogc:def:crs,crs:EPSG::6358," + "cs:EPSG::6497," + "coordinateOperation:EPSG::7812", + dbContext); + auto crs = nn_dynamic_pointer_cast<DerivedVerticalCRS>(obj); + ASSERT_TRUE(crs != nullptr); + EXPECT_EQ(crs->nameStr(), "NAVD88 height (ftUS)"); + } + + { auto obj = createFromUserInput("urn:ogc:def:coordinateOperation," "coordinateOperation:EPSG::3895," "coordinateOperation:EPSG::1618", |
