diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-04-30 14:56:32 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-04-30 14:56:32 +0200 |
| commit | b4a9e65cec051ca3cb16b8cccfa012d70ce10570 (patch) | |
| tree | 819b78cdd3d32143519c4c9315ec231ea9584cb1 /src/iso19111/coordinateoperation.cpp | |
| parent | cca27b1fae234a90df42ff5341121759846dc39b (diff) | |
| download | PROJ-b4a9e65cec051ca3cb16b8cccfa012d70ce10570.tar.gz PROJ-b4a9e65cec051ca3cb16b8cccfa012d70ce10570.zip | |
createOperations(): in SourceTargetCRSExtentUse::INTERSECTION mode, early return if the intersection of the areas is empty
Diffstat (limited to 'src/iso19111/coordinateoperation.cpp')
| -rw-r--r-- | src/iso19111/coordinateoperation.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp index 2cab05bd..ca882f49 100644 --- a/src/iso19111/coordinateoperation.cpp +++ b/src/iso19111/coordinateoperation.cpp @@ -12669,6 +12669,17 @@ CoordinateOperationFactory::createOperations( auto l_resolvedTargetCRS = getResolvedCRS(l_targetCRS, context); Private::Context contextPrivate(l_resolvedSourceCRS, l_resolvedTargetCRS, context); + + if (context->getSourceAndTargetCRSExtentUse() == + CoordinateOperationContext::SourceTargetCRSExtentUse::INTERSECTION) { + auto sourceCRSExtent(getExtent(l_resolvedSourceCRS)); + auto targetCRSExtent(getExtent(l_resolvedTargetCRS)); + if (sourceCRSExtent && targetCRSExtent && + !sourceCRSExtent->intersects(NN_NO_CHECK(targetCRSExtent))) { + return std::vector<CoordinateOperationNNPtr>(); + } + } + return filterAndSort(Private::createOperations(l_resolvedSourceCRS, l_resolvedTargetCRS, contextPrivate), |
