From c45855b38f701a66a96cbd3fe4534f6a52c393b1 Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Thu, 3 Oct 2019 15:10:23 +0200 Subject: DerivedGeographicCRS: allow exporting +proj=ob_tran +o_proj=longlat to PROJ string --- src/iso19111/crs.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/iso19111/crs.cpp b/src/iso19111/crs.cpp index e4e05166..d0e23f95 100644 --- a/src/iso19111/crs.cpp +++ b/src/iso19111/crs.cpp @@ -4736,8 +4736,18 @@ void DerivedGeographicCRS::_exportToWKT(io::WKTFormatter *formatter) const { // --------------------------------------------------------------------------- void DerivedGeographicCRS::_exportToPROJString( - io::PROJStringFormatter *) const // throw(io::FormattingException) + io::PROJStringFormatter *formatter) const // throw(io::FormattingException) { + const auto &l_conv = derivingConversionRef(); + const auto &methodName = l_conv->method()->nameStr(); + if (methodName == "PROJ ob_tran o_proj=longlat" || + methodName == "PROJ ob_tran o_proj=lonlat" || + methodName == "PROJ ob_tran o_proj=latlong" || + methodName == "PROJ ob_tran o_proj=latlon") { + l_conv->_exportToPROJString(formatter); + return; + } + throw io::FormattingException( "DerivedGeographicCRS cannot be exported to PROJ string"); } -- cgit v1.2.3