aboutsummaryrefslogtreecommitdiff
path: root/test/unit/test_operationfactory.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-07-20 17:02:53 +0200
committerGitHub <noreply@github.com>2021-07-20 17:02:53 +0200
commitd973e5a56825b04f2038456b8fc7290dafa79a28 (patch)
tree318a8d919add94a09436a87b8c9509d26151f33c /test/unit/test_operationfactory.cpp
parentff2d8357be7a2cf7d845aabca9f1141136c349be (diff)
parent3126383bebf1f2a16bffda30680c79333d5bb9cc (diff)
downloadPROJ-d973e5a56825b04f2038456b8fc7290dafa79a28.tar.gz
PROJ-d973e5a56825b04f2038456b8fc7290dafa79a28.zip
Merge pull request #2783 from OSGeo/backport-2782-to-8.1
[Backport 8.1] createOperations(): fix SourceTargetCRSExtentUse::NONE mode
Diffstat (limited to 'test/unit/test_operationfactory.cpp')
-rw-r--r--test/unit/test_operationfactory.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/unit/test_operationfactory.cpp b/test/unit/test_operationfactory.cpp
index 8c79e308..47c6636c 100644
--- a/test/unit/test_operationfactory.cpp
+++ b/test/unit/test_operationfactory.cpp
@@ -2123,6 +2123,47 @@ TEST(
// ---------------------------------------------------------------------------
+TEST(operation, projCRS_to_geogCRS_crs_extent_use_none) {
+ auto authFactory =
+ AuthorityFactory::create(DatabaseContext::create(), "EPSG");
+ {
+ auto ctxt =
+ CoordinateOperationContext::create(authFactory, nullptr, 0.0);
+ auto list = CoordinateOperationFactory::create()->createOperations(
+ authFactory->createCoordinateReferenceSystem("23031"), // ED50 UTM31
+ authFactory->createCoordinateReferenceSystem("4326"), ctxt);
+ bool found_EPSG_15964 = false;
+ for (const auto &op : list) {
+ if (op->nameStr().find("ED50 to WGS 84 (42)") !=
+ std::string::npos) {
+ found_EPSG_15964 = true;
+ }
+ }
+ // not expected since doesn't intersect EPSG:23031 area of use
+ EXPECT_FALSE(found_EPSG_15964);
+ }
+ {
+ auto ctxt =
+ CoordinateOperationContext::create(authFactory, nullptr, 0.0);
+ // Ignore source and target CRS extent
+ ctxt->setSourceAndTargetCRSExtentUse(
+ CoordinateOperationContext::SourceTargetCRSExtentUse::NONE);
+ auto list = CoordinateOperationFactory::create()->createOperations(
+ authFactory->createCoordinateReferenceSystem("23031"), // ED50 UTM31
+ authFactory->createCoordinateReferenceSystem("4326"), ctxt);
+ bool found_EPSG_15964 = false;
+ for (const auto &op : list) {
+ if (op->nameStr().find("ED50 to WGS 84 (42)") !=
+ std::string::npos) {
+ found_EPSG_15964 = true;
+ }
+ }
+ EXPECT_TRUE(found_EPSG_15964);
+ }
+}
+
+// ---------------------------------------------------------------------------
+
TEST(operation, projCRS_to_projCRS_north_pole_inverted_axis) {
auto authFactory =