diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-08-16 11:59:22 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2021-08-16 11:59:22 +0200 |
| commit | 30d220143aa83217c97ce4c4f24e65ca6276ba46 (patch) | |
| tree | 27aaa2c7ba02cc9a8be2293018bd7193ccbad2dc /src/iso19111/operation/coordinateoperationfactory.cpp | |
| parent | 9b0c8afcf106f4385ff282bfc9b12d82edaadcf7 (diff) | |
| download | PROJ-30d220143aa83217c97ce4c4f24e65ca6276ba46.tar.gz PROJ-30d220143aa83217c97ce4c4f24e65ca6276ba46.zip | |
createOperations(): fix missing deg<-->rad conversion when transforming with a CRS that has a fallback-to-PROJ4-string behaviour and is a BoundCRS of a GeographicCRS (fixes #2804)
Diffstat (limited to 'src/iso19111/operation/coordinateoperationfactory.cpp')
| -rw-r--r-- | src/iso19111/operation/coordinateoperationfactory.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/iso19111/operation/coordinateoperationfactory.cpp b/src/iso19111/operation/coordinateoperationfactory.cpp index d63db19e..fc64bd2e 100644 --- a/src/iso19111/operation/coordinateoperationfactory.cpp +++ b/src/iso19111/operation/coordinateoperationfactory.cpp @@ -3121,7 +3121,8 @@ void CoordinateOperationFactory::Private::createOperationsFromProj4Ext( projFormatter->setLegacyCRSToCRSContext(true); projFormatter->startInversion(); sourceProjExportable->_exportToPROJString(projFormatter.get()); - auto geogSrc = dynamic_cast<const crs::GeographicCRS *>(sourceCRS.get()); + auto geogSrc = dynamic_cast<const crs::GeographicCRS *>( + boundSrc ? boundSrc->baseCRS().get() : sourceCRS.get()); if (geogSrc) { auto tmpFormatter = io::PROJStringFormatter::create(); geogSrc->addAngularUnitConvertAndAxisSwap(tmpFormatter.get()); @@ -3131,7 +3132,8 @@ void CoordinateOperationFactory::Private::createOperationsFromProj4Ext( projFormatter->stopInversion(); targetProjExportable->_exportToPROJString(projFormatter.get()); - auto geogDst = dynamic_cast<const crs::GeographicCRS *>(targetCRS.get()); + auto geogDst = dynamic_cast<const crs::GeographicCRS *>( + boundDst ? boundDst->baseCRS().get() : targetCRS.get()); if (geogDst) { auto tmpFormatter = io::PROJStringFormatter::create(); geogDst->addAngularUnitConvertAndAxisSwap(tmpFormatter.get()); |
