From 7f7f2921ada88ee90fb81dddb782d47c764642b7 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 2 Oct 2020 21:53:44 +0200 Subject: createOperations(): avoid elimination of ballpark transformation that can help for NAD83->WGS84->NAD83(2011) hops --- src/iso19111/coordinateoperation.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp index e150bc15..6593d3e9 100644 --- a/src/iso19111/coordinateoperation.cpp +++ b/src/iso19111/coordinateoperation.cpp @@ -14340,8 +14340,9 @@ void CoordinateOperationFactory::Private::createOperationsBoundToGeog( for (const auto &opFirst : opsFirst) { for (const auto &opLast : opsLast) { // Exclude artificial transformations from the hub - // to the target CRS - if (!opLast->hasBallparkTransformation()) { + // to the target CRS, if it is the only one. + if (opsLast.size() > 1 || + !opLast->hasBallparkTransformation()) { try { res.emplace_back( ConcatenatedOperation::createComputeMetadata( @@ -14349,6 +14350,9 @@ void CoordinateOperationFactory::Private::createOperationsBoundToGeog( disallowEmptyIntersection)); } catch (const InvalidOperationEmptyIntersection &) { } + } else { + // std::cerr << "excluded " << opLast->nameStr() << + // std::endl; } } } @@ -14432,6 +14436,9 @@ void CoordinateOperationFactory::Private::createOperationsBoundToGeog( } catch ( const InvalidOperationEmptyIntersection &) { } + } else { + // std::cerr << "excluded " << opLast->nameStr() << + // std::endl; } } } @@ -15201,11 +15208,14 @@ void CoordinateOperationFactory::Private::createOperationsCompoundToCompound( createOperations(intermGeogSrc, intermGeogDst, context); for (const auto &op1 : opsSrcToGeog) { if (op1->hasBallparkTransformation()) { + // std::cerr << "excluded " << op1->nameStr() << std::endl; continue; } for (const auto &op2 : opsGeogSrcToGeogDst) { for (const auto &op3 : opsGeogToTarget) { if (op3->hasBallparkTransformation()) { + // std::cerr << "excluded " << op3->nameStr() << + // std::endl; continue; } try { -- cgit v1.2.3