aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_crs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/test_crs.cpp')
-rw-r--r--test/unit/test_crs.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/unit/test_crs.cpp b/test/unit/test_crs.cpp
index a0fee905..38afdce3 100644
--- a/test/unit/test_crs.cpp
+++ b/test/unit/test_crs.cpp
@@ -5796,6 +5796,31 @@ TEST(crs, crs_createBoundCRSToWGS84IfPossible) {
CoordinateOperationContext::IntermediateCRSUse::NEVER),
crs_5340);
}
+
+ // Check that we get the same result from an EPSG code and a CRS created
+ // from its WKT1 representation.
+ {
+ // Pulkovo 1942 / CS63 zone A2
+ auto crs = factory->createCoordinateReferenceSystem("2936");
+
+ // Two candidate transformations found, so not picking up any
+ EXPECT_EQ(crs->createBoundCRSToWGS84IfPossible(
+ dbContext,
+ CoordinateOperationContext::IntermediateCRSUse::NEVER),
+ crs);
+
+ auto wkt = crs->exportToWKT(
+ WKTFormatter::create(WKTFormatter::Convention::WKT1_GDAL, dbContext)
+ .get());
+ auto obj =
+ WKTParser().attachDatabaseContext(dbContext).createFromWKT(wkt);
+ auto crs_from_wkt = nn_dynamic_pointer_cast<CRS>(obj);
+ ASSERT_TRUE(crs_from_wkt != nullptr);
+ EXPECT_EQ(crs_from_wkt->createBoundCRSToWGS84IfPossible(
+ dbContext,
+ CoordinateOperationContext::IntermediateCRSUse::NEVER),
+ crs_from_wkt);
+ }
}
// ---------------------------------------------------------------------------