aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_operationfactory.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-08-16 11:59:22 +0200
committerEven Rouault <even.rouault@spatialys.com>2021-08-16 11:59:22 +0200
commit30d220143aa83217c97ce4c4f24e65ca6276ba46 (patch)
tree27aaa2c7ba02cc9a8be2293018bd7193ccbad2dc /test/unit/test_operationfactory.cpp
parent9b0c8afcf106f4385ff282bfc9b12d82edaadcf7 (diff)
downloadPROJ-30d220143aa83217c97ce4c4f24e65ca6276ba46.tar.gz
PROJ-30d220143aa83217c97ce4c4f24e65ca6276ba46.zip
createOperations(): fix missing deg<-->rad conversion when transforming with a CRS that has a fallback-to-PROJ4-string behaviour and is a BoundCRS of a GeographicCRS (fixes #2804)
Diffstat (limited to 'test/unit/test_operationfactory.cpp')
-rw-r--r--test/unit/test_operationfactory.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/unit/test_operationfactory.cpp b/test/unit/test_operationfactory.cpp
index 47c6636c..56d9f743 100644
--- a/test/unit/test_operationfactory.cpp
+++ b/test/unit/test_operationfactory.cpp
@@ -6108,6 +6108,30 @@ TEST(operation, createOperation_fallback_to_proj4_strings) {
// ---------------------------------------------------------------------------
+TEST(operation, createOperation_fallback_to_proj4_strings_bound_of_geog) {
+ auto objSrc = PROJStringParser().createFromPROJString(
+ "+proj=longlat +geoc +ellps=GRS80 +towgs84=0,0,0 +type=crs");
+ auto src = nn_dynamic_pointer_cast<BoundCRS>(objSrc);
+ ASSERT_TRUE(src != nullptr);
+
+ auto objDest = PROJStringParser().createFromPROJString(
+ "+proj=longlat +geoc +ellps=clrk66 +towgs84=0,0,0 +type=crs");
+ auto dest = nn_dynamic_pointer_cast<BoundCRS>(objDest);
+ ASSERT_TRUE(dest != nullptr);
+
+ auto op = CoordinateOperationFactory::create()->createOperation(
+ NN_CHECK_ASSERT(src), NN_CHECK_ASSERT(dest));
+ ASSERT_TRUE(op != nullptr);
+ EXPECT_EQ(op->exportToPROJString(PROJStringFormatter::create().get()),
+ "+proj=pipeline "
+ "+step +proj=unitconvert +xy_in=deg +xy_out=rad "
+ "+step +inv +proj=longlat +geoc +ellps=GRS80 +towgs84=0,0,0 "
+ "+step +proj=longlat +geoc +ellps=clrk66 +towgs84=0,0,0 "
+ "+step +proj=unitconvert +xy_in=rad +xy_out=deg");
+}
+
+// ---------------------------------------------------------------------------
+
TEST(
operation,
createOperation_fallback_to_proj4_strings_regular_with_datum_to_projliteral) {