diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-12-01 00:16:15 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-12-03 14:27:35 +0100 |
| commit | 5a7ff4380e9526aca0287e45b27a8b37664e9708 (patch) | |
| tree | 446c438497bdd02a6df80cb98130462af77787cc /src | |
| parent | a0de56228be06427c7870cbc1923b11dad11856e (diff) | |
| download | PROJ-5a7ff4380e9526aca0287e45b27a8b37664e9708.tar.gz PROJ-5a7ff4380e9526aca0287e45b27a8b37664e9708.zip | |
Database: register AUSGeoid09 and AUSGeoid2020
Related to https://github.com/OSGeo/proj-datumgrid/pull/66
Tune operation search so that it can work with Geog2D <--> VertCS for commandline
niceness
Diffstat (limited to 'src')
| -rw-r--r-- | src/iso19111/coordinateoperation.cpp | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp index c295aff2..1e806e31 100644 --- a/src/iso19111/coordinateoperation.cpp +++ b/src/iso19111/coordinateoperation.cpp @@ -12923,9 +12923,40 @@ bool CoordinateOperationFactory::Private::createOperationsFromDatabase( bool sameGeodeticDatum = false; if (vertSrc || vertDst) { - createOperationsFromDatabaseWithVertCRS(sourceCRS, targetCRS, context, - geogSrc, geogDst, vertSrc, - vertDst, res); + if (res.empty()) { + if (geogSrc && + geogSrc->coordinateSystem()->axisList().size() == 2 && + vertDst) { + auto dbContext = + context.context->getAuthorityFactory()->databaseContext(); + auto resTmp = findOpsInRegistryDirect( + sourceCRS->promoteTo3D(std::string(), dbContext), targetCRS, + context, resFindDirectNonEmptyBeforeFiltering); + for (auto &op : resTmp) { + auto newOp = op->shallowClone(); + setCRSs(newOp.get(), sourceCRS, targetCRS); + res.emplace_back(newOp); + } + } else if (geogDst && + geogDst->coordinateSystem()->axisList().size() == 2 && + vertSrc) { + auto dbContext = + context.context->getAuthorityFactory()->databaseContext(); + auto resTmp = findOpsInRegistryDirect( + sourceCRS, targetCRS->promoteTo3D(std::string(), dbContext), + context, resFindDirectNonEmptyBeforeFiltering); + for (auto &op : resTmp) { + auto newOp = op->shallowClone(); + setCRSs(newOp.get(), sourceCRS, targetCRS); + res.emplace_back(newOp); + } + } + } + if (res.empty()) { + createOperationsFromDatabaseWithVertCRS(sourceCRS, targetCRS, + context, geogSrc, geogDst, + vertSrc, vertDst, res); + } } else if (geodSrc && geodDst) { const auto &srcDatum = geodSrc->datum(); |
