aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_operationfactory.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-09-18 13:13:47 +0200
committerEven Rouault <even.rouault@spatialys.com>2021-09-18 13:13:47 +0200
commit527e1eb983955a82b87003d6c369c931a3ca0e36 (patch)
treea66543ba0e904341abbf0eed8165f5c940a4f21c /test/unit/test_operationfactory.cpp
parent438ead90d3502f1bf2cb6ed466e75661f33c9445 (diff)
downloadPROJ-527e1eb983955a82b87003d6c369c931a3ca0e36.tar.gz
PROJ-527e1eb983955a82b87003d6c369c931a3ca0e36.zip
Optimize pipelines of planetary CRS (geocentric latitude, west-positive longitude)
Diffstat (limited to 'test/unit/test_operationfactory.cpp')
-rw-r--r--test/unit/test_operationfactory.cpp57
1 files changed, 57 insertions, 0 deletions
diff --git a/test/unit/test_operationfactory.cpp b/test/unit/test_operationfactory.cpp
index 2ee5a53c..31b23287 100644
--- a/test/unit/test_operationfactory.cpp
+++ b/test/unit/test_operationfactory.cpp
@@ -6953,3 +6953,60 @@ TEST(operation,
"+step +inv +proj=geoc +ellps=WGS84 "
"+step +proj=utm +zone=11 +ellps=WGS84");
}
+
+// ---------------------------------------------------------------------------
+
+TEST(operation,
+ createOperation_spherical_ocentric_spherical_to_ellipsoidal_north_west) {
+ auto objSrc = WKTParser().createFromWKT(
+ "GEODCRS[\"Mercury (2015) - Sphere / Ocentric\",\n"
+ " DATUM[\"Mercury (2015) - Sphere\",\n"
+ " ELLIPSOID[\"Mercury (2015) - Sphere\",2440530,0,\n"
+ " LENGTHUNIT[\"metre\",1]]],\n"
+ " PRIMEM[\"Reference Meridian\",0,\n"
+ " ANGLEUNIT[\"degree\",0.0174532925199433]],\n"
+ " CS[spherical,2],\n"
+ " AXIS[\"planetocentric latitude (U)\",north,\n"
+ " ORDER[1],\n"
+ " ANGLEUNIT[\"degree\",0.0174532925199433]],\n"
+ " AXIS[\"planetocentric longitude (V)\",east,\n"
+ " ORDER[2],\n"
+ " ANGLEUNIT[\"degree\",0.0174532925199433]]]");
+ auto src = nn_dynamic_pointer_cast<CRS>(objSrc);
+ ASSERT_TRUE(src != nullptr);
+
+ auto objDest = WKTParser().createFromWKT(
+ "GEOGCRS[\"Mercury (2015) / Ographic\",\n"
+ " DATUM[\"Mercury (2015)\",\n"
+ " ELLIPSOID[\"Mercury (2015)\",2440530,1075.12334801762,\n"
+ " LENGTHUNIT[\"metre\",1]]],\n"
+ " PRIMEM[\"Reference Meridian\",0,\n"
+ " ANGLEUNIT[\"degree\",0.0174532925199433]],\n"
+ " CS[ellipsoidal,2],\n"
+ " AXIS[\"latitude\",north,\n"
+ " ORDER[1],\n"
+ " ANGLEUNIT[\"degree\",0.0174532925199433]],\n"
+ " AXIS[\"longitude\",west,\n"
+ " ORDER[2],\n"
+ " ANGLEUNIT[\"degree\",0.0174532925199433]]]"
+
+ );
+ auto dest = nn_dynamic_pointer_cast<CRS>(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=axisswap +order=1,-2");
+ }
+
+ {
+ auto op = CoordinateOperationFactory::create()->createOperation(
+ NN_CHECK_ASSERT(dest), NN_CHECK_ASSERT(src));
+ ASSERT_TRUE(op != nullptr);
+ EXPECT_EQ(op->exportToPROJString(PROJStringFormatter::create().get()),
+ "+proj=axisswap +order=1,-2");
+ }
+}