aboutsummaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-09-17 19:46:07 +0200
committerEven Rouault <even.rouault@spatialys.com>2020-09-17 19:46:07 +0200
commit75074ce863e36299ec39b39decdd435eed15ad63 (patch)
tree448fb1ab3c3152224450b6a07f723ba14623b727 /test/unit
parentaeb024f2df5fb1c4d83959b6b9edcb62e8385226 (diff)
downloadPROJ-75074ce863e36299ec39b39decdd435eed15ad63.tar.gz
PROJ-75074ce863e36299ec39b39decdd435eed15ad63.zip
createOperations(): tune sorting of transformations so that the ones with greater 'version numbers' are prefered over other ones, when all other comparison criteria are equal. Helps with Amersfoort RD New to EPSG:4326
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/test_operation.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/unit/test_operation.cpp b/test/unit/test_operation.cpp
index eca5d59b..23f3489b 100644
--- a/test/unit/test_operation.cpp
+++ b/test/unit/test_operation.cpp
@@ -6214,6 +6214,24 @@ TEST(operation, projCRS_to_projCRS_through_geog3D) {
// ---------------------------------------------------------------------------
+TEST(operation, transform_from_amersfoort_rd_new_to_epsg_4326) {
+ auto authFactory =
+ AuthorityFactory::create(DatabaseContext::create(), "EPSG");
+ auto ctxt = CoordinateOperationContext::create(authFactory, nullptr, 0.0);
+ auto list = CoordinateOperationFactory::create()->createOperations(
+ authFactory->createCoordinateReferenceSystem("28992"),
+ authFactory->createCoordinateReferenceSystem("4326"), ctxt);
+ ASSERT_EQ(list.size(), 2U);
+ // The order matters: "Amersfoort to WGS 84 (4)" replaces "Amersfoort to WGS
+ // 84 (3)"
+ EXPECT_EQ(list[0]->nameStr(),
+ "Inverse of RD New + Amersfoort to WGS 84 (4)");
+ EXPECT_EQ(list[1]->nameStr(),
+ "Inverse of RD New + Amersfoort to WGS 84 (3)");
+}
+
+// ---------------------------------------------------------------------------
+
TEST(operation, boundCRS_of_geogCRS_to_geogCRS) {
auto boundCRS = BoundCRS::createFromTOWGS84(
GeographicCRS::EPSG_4807, std::vector<double>{1, 2, 3, 4, 5, 6, 7});