aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-11-25 13:08:05 +0100
committerGitHub <noreply@github.com>2019-11-25 13:08:05 +0100
commitbc5148feb26726f55babe885090e4b7ff2d1d481 (patch)
tree5f4918085597e717cbf831462631e74d770d58aa /src
parent875aba7c9d894f84f2c6a5efdfdeba9cf15245f5 (diff)
parent685a64466a3bc25a8d0bdb0b0f932ad7e977620d (diff)
downloadPROJ-bc5148feb26726f55babe885090e4b7ff2d1d481.tar.gz
PROJ-bc5148feb26726f55babe885090e4b7ff2d1d481.zip
Merge pull request #1746 from rouault/fix_1736
normalizeForVisualization() and other methods applying on a ProjectedCRS: do not mess the derivingConversion object of the original object (fixes #1736)
Diffstat (limited to 'src')
-rw-r--r--src/iso19111/crs.cpp21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/iso19111/crs.cpp b/src/iso19111/crs.cpp
index cf533bd3..eb15b0d8 100644
--- a/src/iso19111/crs.cpp
+++ b/src/iso19111/crs.cpp
@@ -237,7 +237,7 @@ CRSNNPtr CRS::alterGeodeticCRS(const GeodeticCRSNNPtr &newGeodCRS) const {
auto projCRS = dynamic_cast<const ProjectedCRS *>(this);
if (projCRS) {
return ProjectedCRS::create(createPropertyMap(this), newGeodCRS,
- projCRS->derivingConversionRef(),
+ projCRS->derivingConversion(),
projCRS->coordinateSystem());
}
@@ -264,7 +264,7 @@ CRSNNPtr CRS::alterCSLinearUnit(const common::UnitOfMeasure &unit) const {
if (projCRS) {
return ProjectedCRS::create(
createPropertyMap(this), projCRS->baseCRS(),
- projCRS->derivingConversionRef(),
+ projCRS->derivingConversion(),
projCRS->coordinateSystem()->alterUnit(unit));
}
}
@@ -675,9 +675,8 @@ CRSNNPtr CRS::normalizeForVisualization() const {
axisList[0])
: cs::CartesianCS::create(util::PropertyMap(), axisList[1],
axisList[0], axisList[2]);
- return util::nn_static_pointer_cast<CRS>(
- ProjectedCRS::create(props, projCRS->baseCRS(),
- projCRS->derivingConversionRef(), cs));
+ return util::nn_static_pointer_cast<CRS>(ProjectedCRS::create(
+ props, projCRS->baseCRS(), projCRS->derivingConversion(), cs));
}
}
@@ -844,7 +843,7 @@ CRSNNPtr CRS::promoteTo3D(const std::string &newName,
!newName.empty() ? newName : nameStr()),
NN_NO_CHECK(
util::nn_dynamic_pointer_cast<GeodeticCRS>(base3DCRS)),
- projCRS->derivingConversionRef(), cs));
+ projCRS->derivingConversion(), cs));
}
}
@@ -3379,10 +3378,10 @@ bool ProjectedCRS::_isEquivalentTo(
ProjectedCRSNNPtr
ProjectedCRS::alterParametersLinearUnit(const common::UnitOfMeasure &unit,
bool convertToNewUnit) const {
- return create(createPropertyMap(this), baseCRS(),
- derivingConversionRef()->alterParametersLinearUnit(
- unit, convertToNewUnit),
- coordinateSystem());
+ return create(
+ createPropertyMap(this), baseCRS(),
+ derivingConversion()->alterParametersLinearUnit(unit, convertToNewUnit),
+ coordinateSystem());
}
//! @endcond
@@ -3791,7 +3790,7 @@ ProjectedCRS::demoteTo2D(const std::string &newName,
return ProjectedCRS::create(
util::PropertyMap().set(common::IdentifiedObject::NAME_KEY,
!newName.empty() ? newName : nameStr()),
- newBaseCRS, derivingConversionRef(), cs);
+ newBaseCRS, derivingConversion(), cs);
}
return NN_NO_CHECK(std::dynamic_pointer_cast<ProjectedCRS>(