aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_operation.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2018-12-13 15:09:06 +0100
committerEven Rouault <even.rouault@spatialys.com>2018-12-13 15:14:45 +0100
commit990d88b09839876598c954230ca66fb2604f7545 (patch)
treeea7faa82174a9c1dfdc5700d2d9b6315b93a4065 /test/unit/test_operation.cpp
parent37c7893bb460bb13673752673ece3f3d6933807d (diff)
downloadPROJ-990d88b09839876598c954230ca66fb2604f7545.tar.gz
PROJ-990d88b09839876598c954230ca66fb2604f7545.zip
another improvement in isEquivalentTo() when comparing Helmert transformations
Diffstat (limited to 'test/unit/test_operation.cpp')
-rw-r--r--test/unit/test_operation.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp
index 66284b59..2695153a 100644
--- a/test/unit/test_operation.cpp
+++ b/test/unit/test_operation.cpp
@@ -6693,6 +6693,32 @@ TEST(operation, three_param_equivalent_to_seven_param) {
// ---------------------------------------------------------------------------
+TEST(operation, position_vector_equivalent_coordinate_frame) {
+
+ auto pv = Transformation::createPositionVector(
+ PropertyMap(), GeographicCRS::EPSG_4269, GeographicCRS::EPSG_4326, 1.0,
+ 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, {});
+
+ auto cf = Transformation::createCoordinateFrameRotation(
+ PropertyMap(), GeographicCRS::EPSG_4269, GeographicCRS::EPSG_4326, 1.0,
+ 2.0, 3.0, -4 + 1e-11, -5.0, -6.0, 7.0, {});
+
+ auto cf_non_eq = Transformation::createCoordinateFrameRotation(
+ PropertyMap(), GeographicCRS::EPSG_4269, GeographicCRS::EPSG_4326, 1.0,
+ 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, {});
+
+ EXPECT_TRUE(
+ pv->isEquivalentTo(cf.get(), IComparable::Criterion::EQUIVALENT));
+
+ EXPECT_TRUE(
+ cf->isEquivalentTo(pv.get(), IComparable::Criterion::EQUIVALENT));
+
+ EXPECT_FALSE(pv->isEquivalentTo(cf_non_eq.get(),
+ IComparable::Criterion::EQUIVALENT));
+}
+
+// ---------------------------------------------------------------------------
+
TEST(operation, conversion_missing_parameter) {
auto wkt1 = "PROJCS[\"NAD83(CSRS98) / UTM zone 20N (deprecated)\","