aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rwxr-xr-xtest/cli/testprojinfo4
-rw-r--r--test/cli/testprojinfo_out.dist5
-rw-r--r--test/unit/test_operationfactory.cpp41
3 files changed, 50 insertions, 0 deletions
diff --git a/test/cli/testprojinfo b/test/cli/testprojinfo
index a9bbfa37..3081966b 100755
--- a/test/cli/testprojinfo
+++ b/test/cli/testprojinfo
@@ -78,6 +78,10 @@ echo "Testing projinfo -s EPSG:4230 -t EPSG:4258 --bbox 8,54.51,15.24,57.8 --sum
$EXE -s EPSG:4230 -t EPSG:4258 --bbox 8,54.51,15.24,57.8 --summary >>${OUT}
echo "" >>${OUT}
+echo "Testing projinfo -s EPSG:23031 -t EPSG:4326 --bbox -13.87,34.91,-7.24,41.88 --crs-extent-use none --summary" >> ${OUT}
+$EXE -s EPSG:23031 -t EPSG:4326 --bbox -13.87,34.91,-7.24,41.88 --crs-extent-use none --summary >>${OUT}
+echo "" >>${OUT}
+
echo "Testing projinfo -s EPSG:4230 -t EPSG:4258 --area EPSG:3237 --summary" >> ${OUT}
$EXE -s EPSG:4230 -t EPSG:4258 --area EPSG:3237 --summary >>${OUT}
echo "" >>${OUT}
diff --git a/test/cli/testprojinfo_out.dist b/test/cli/testprojinfo_out.dist
index 9f2fb22b..6c3a37c4 100644
--- a/test/cli/testprojinfo_out.dist
+++ b/test/cli/testprojinfo_out.dist
@@ -904,6 +904,11 @@ Candidate operations found: 1
Note: using '--spatial-test intersects' would bring more results (2)
EPSG:1626, ED50 to ETRS89 (4), 1.0 m, Denmark - onshore.
+Testing projinfo -s EPSG:23031 -t EPSG:4326 --bbox -13.87,34.91,-7.24,41.88 --crs-extent-use none --summary
+Candidate operations found: 1
+Note: using '--spatial-test intersects' would bring more results (9)
+unknown id, Inverse of UTM zone 31N + ED50 to WGS 84 (42), 5 m, Portugal - mainland - offshore.
+
Testing projinfo -s EPSG:4230 -t EPSG:4258 --area EPSG:3237 --summary
Candidate operations found: 1
Note: using '--spatial-test intersects' would bring more results (2)
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 =