diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2019-11-25 04:54:17 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2019-11-25 05:19:59 +0100 |
| commit | 685a64466a3bc25a8d0bdb0b0f932ad7e977620d (patch) | |
| tree | 5f4918085597e717cbf831462631e74d770d58aa /include | |
| parent | 875aba7c9d894f84f2c6a5efdfdeba9cf15245f5 (diff) | |
| download | PROJ-685a64466a3bc25a8d0bdb0b0f932ad7e977620d.tar.gz PROJ-685a64466a3bc25a8d0bdb0b0f932ad7e977620d.zip | |
normalizeForVisualization() and other methods applying on a ProjectedCRS: do not mess the derivingConversion object of the original object (fixes #1736)
normalizeForVisualization(), promoteTo3D(), demoteTo2D(), alterGeodeticCRS(),
alterCSLinearUnit() and alterParametersLinearUnit() all used the object
returned by derivingConversionRef() to create a new ProjectedCRS. While doing
so, this caused the derivingConversion of the original object to have its
targetCRS set to the object returned by normalizeForVisualization() and similar.
If that object died, then the weak pointer would be reset, and the original
ProjectedCRS() has now its derivingConversionRef()->targetCRS() nullptr
So bottom line is use derivingConversion() for anything that is not pure
reading !!!
This is confirmed to be the fix for the QGIS scenario in
https://github.com/qgis/QGIS/issues/30569#issuecomment-540060919
In QGIS use case, the issue arised when using a projected CRS with a non-GIS
friendly axis (that is where normalizeForVisualization() created a new projectedCRS)
Diffstat (limited to 'include')
| -rw-r--r-- | include/proj/crs.hpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/proj/crs.hpp b/include/proj/crs.hpp index 2b919c71..356c29d9 100644 --- a/include/proj/crs.hpp +++ b/include/proj/crs.hpp @@ -514,6 +514,9 @@ class PROJ_GCC_DLL DerivedCRS : virtual public SingleCRS { PROJ_PRIVATE : //! @cond Doxygen_Suppress + + // Use this method with extreme care ! It should never be used + // to recreate a new Derived/ProjectedCRS ! PROJ_INTERNAL const operation::ConversionNNPtr & derivingConversionRef() PROJ_PURE_DECL; |
