From a918082e5875aac849f80b18a8ee1a2cdff8056e Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 14 May 2020 20:11:32 +0200 Subject: BoundCRS::create(): simplify --- src/iso19111/crs.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'src/iso19111/crs.cpp') 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 &TOWGS84Parameters) { - - auto geodCRS = baseCRSIn->extractGeodeticCRS(); - auto targetCRS = - geodCRS.get() == nullptr || - dynamic_cast(geodCRS.get()) - ? util::nn_static_pointer_cast( - crs::GeographicCRS::EPSG_4326) - : util::nn_static_pointer_cast( - 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); } // --------------------------------------------------------------------------- -- cgit v1.2.3