diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-05-06 12:43:04 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-05-06 12:43:04 +0200 |
| commit | 5e98fed78205605ccb01ab4310d3cba292de73b4 (patch) | |
| tree | 6a221f6031a5e77639d8b6c9b11fc13caa5f7715 /src | |
| parent | a16cb05010115690ecca8938d95ca544f2ad65c6 (diff) | |
| download | PROJ-5e98fed78205605ccb01ab4310d3cba292de73b4.tar.gz PROJ-5e98fed78205605ccb01ab4310d3cba292de73b4.zip | |
createOperations(): fix case of ETRS89 3D to proj string with nadgrids and geoidgrids
Fixes https://lists.osgeo.org/pipermail/proj/2019-May/008519.html
Diffstat (limited to 'src')
| -rw-r--r-- | src/iso19111/coordinateoperation.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp index 605004b6..f75f7588 100644 --- a/src/iso19111/coordinateoperation.cpp +++ b/src/iso19111/coordinateoperation.cpp @@ -12135,6 +12135,37 @@ CoordinateOperationFactory::Private::createOperations( } } + auto vertCRSOfBaseOfBoundSrc = + dynamic_cast<const crs::VerticalCRS *>(boundSrc->baseCRS().get()); + if (vertCRSOfBaseOfBoundSrc && hubSrcGeog && + hubSrcGeog->coordinateSystem()->axisList().size() == 3 && + geogDst->coordinateSystem()->axisList().size() == 3) { + auto opsFirst = createOperations(sourceCRS, hubSrc, context); + auto opsSecond = createOperations(hubSrc, targetCRS, context); + if (!opsFirst.empty() && !opsSecond.empty()) { + for (const auto &opFirst : opsFirst) { + for (const auto &opLast : opsSecond) { + // Exclude artificial transformations from the hub + // to the target CRS + if (!opLast->hasBallparkTransformation()) { + try { + res.emplace_back( + ConcatenatedOperation:: + createComputeMetadata( + {opFirst, opLast}, + !allowEmptyIntersection)); + } catch ( + const InvalidOperationEmptyIntersection &) { + } + } + } + } + if (!res.empty()) { + return res; + } + } + } + return createOperations(boundSrc->baseCRS(), targetCRS, context); } |
