aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_operation.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-01-09 23:27:39 +0100
committerEven Rouault <even.rouault@spatialys.com>2019-01-09 23:27:39 +0100
commit6d5924842035ae6b5af8a6685f5c531e667c7f18 (patch)
treed259e2dcb48cf991f24945525e1a88574d53cc4b /test/unit/test_operation.cpp
parent5b75e5fdccc531f7b0e3dcd636fa1ff3500bb071 (diff)
downloadPROJ-6d5924842035ae6b5af8a6685f5c531e667c7f18.tar.gz
PROJ-6d5924842035ae6b5af8a6685f5c531e667c7f18.zip
createOperations(): fix a particular case of boundcrs to boundcrs transformation (fixes #1220)
Diffstat (limited to 'test/unit/test_operation.cpp')
-rw-r--r--test/unit/test_operation.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp
index 379ef31a..d3f05548 100644
--- a/test/unit/test_operation.cpp
+++ b/test/unit/test_operation.cpp
@@ -5552,6 +5552,29 @@ TEST(operation, boundCRS_to_boundCRS_unralated_hub) {
// ---------------------------------------------------------------------------
+TEST(operation, boundCRS_of_projCRS_towgs84_to_boundCRS_of_projCRS_nadgrids) {
+ auto objSrc = PROJStringParser().createFromPROJString(
+ "+proj=utm +zone=15 +datum=NAD83 +units=m +no_defs +ellps=GRS80 "
+ "+towgs84=0,0,0");
+ auto src = nn_dynamic_pointer_cast<CRS>(objSrc);
+ ASSERT_TRUE(src != nullptr);
+ auto objDst = PROJStringParser().createFromPROJString(
+ "+proj=utm +zone=15 +datum=NAD27 +units=m +no_defs +ellps=clrk66 "
+ "+nadgrids=@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat");
+ auto dst = nn_dynamic_pointer_cast<CRS>(objDst);
+ ASSERT_TRUE(dst != nullptr);
+ auto op = CoordinateOperationFactory::create()->createOperation(
+ NN_CHECK_ASSERT(src), NN_CHECK_ASSERT(dst));
+ ASSERT_TRUE(op != nullptr);
+ EXPECT_EQ(op->exportToPROJString(PROJStringFormatter::create().get()),
+ "+proj=pipeline +step +inv +proj=utm +zone=15 +ellps=GRS80 +step "
+ "+inv +proj=hgridshift "
+ "+grids=@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat +step +proj=utm "
+ "+zone=15 +ellps=clrk66");
+}
+
+// ---------------------------------------------------------------------------
+
TEST(operation, boundCRS_with_basecrs_with_extent_to_geogCRS) {
auto wkt =