aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-05-14 20:11:32 +0200
committerEven Rouault <even.rouault@spatialys.com>2020-05-14 20:21:13 +0200
commita918082e5875aac849f80b18a8ee1a2cdff8056e (patch)
treeb0cbc68ce19d8a01c3d49890725070fdfab3730d
parent056226ee668f027e22baf6897da7507bcc98e132 (diff)
downloadPROJ-a918082e5875aac849f80b18a8ee1a2cdff8056e.tar.gz
PROJ-a918082e5875aac849f80b18a8ee1a2cdff8056e.zip
BoundCRS::create(): simplify
-rw-r--r--src/iso19111/crs.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/iso19111/crs.cpp b/src/iso19111/crs.cpp
index c23bd29b..ec342a8f 100644
--- a/src/iso19111/crs.cpp
+++ b/src/iso19111/crs.cpp
@@ -4620,18 +4620,9 @@ BoundCRS::create(const CRSNNPtr &baseCRSIn, const CRSNNPtr &hubCRSIn,
BoundCRSNNPtr
BoundCRS::createFromTOWGS84(const CRSNNPtr &baseCRSIn,
const std::vector<double> &TOWGS84Parameters) {
-
- auto geodCRS = baseCRSIn->extractGeodeticCRS();
- auto targetCRS =
- geodCRS.get() == nullptr ||
- dynamic_cast<const crs::GeographicCRS *>(geodCRS.get())
- ? util::nn_static_pointer_cast<crs::CRS>(
- crs::GeographicCRS::EPSG_4326)
- : util::nn_static_pointer_cast<crs::CRS>(
- crs::GeodeticCRS::EPSG_4978);
- return create(
- baseCRSIn, targetCRS,
- operation::Transformation::createTOWGS84(baseCRSIn, TOWGS84Parameters));
+ auto transf =
+ operation::Transformation::createTOWGS84(baseCRSIn, TOWGS84Parameters);
+ return create(baseCRSIn, transf->targetCRS(), transf);
}
// ---------------------------------------------------------------------------