diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-07-20 04:28:09 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2021-07-20 04:28:13 +0200 |
| commit | be83b7dd836a94ce7cba999716f8bff1c2effac0 (patch) | |
| tree | 714495c294b02ae95879b798300afec46996fd16 /test/unit/test_operationfactory.cpp | |
| parent | 88147888b8cbfcd7bcba6991de857029ac095dc6 (diff) | |
| download | PROJ-be83b7dd836a94ce7cba999716f8bff1c2effac0.tar.gz PROJ-be83b7dd836a94ce7cba999716f8bff1c2effac0.zip | |
createOperations(): fix SourceTargetCRSExtentUse::NONE mode
Fix issue reported in https://lists.osgeo.org/pipermail/proj/2021-July/010318.html
Diffstat (limited to 'test/unit/test_operationfactory.cpp')
| -rw-r--r-- | test/unit/test_operationfactory.cpp | 41 |
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 = |
