diff options
Diffstat (limited to 'src/iso19111/crs.cpp')
| -rw-r--r-- | src/iso19111/crs.cpp | 15 |
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); } // --------------------------------------------------------------------------- |
