Skip to content
Permalink
Browse files

Revert "Don't automatically create boundcrs proj string representatio…

…ns of CRSes"

Following discussion with GDAL maintainers, it's been agreed that the consistent logic
to use across projects should be:

1. Proj strings: export as bound CRS, and treat a boundcrs match to a known CRS as equivalent
to the underlying source CRS

2. WKT strings: export without change, not as bound CRS, and DON'T treat boundcrs matches
as equivalent to the underlying source CRS
  • Loading branch information
nyalldawson committed Dec 18, 2019
1 parent 93fdb05 commit 4b5056c6f5d157370375fc0bfbe8e6870d42f1a5
Showing with 12 additions and 1 deletion.
  1. +12 −1 src/core/qgscoordinatereferencesystem.cpp
@@ -92,7 +92,18 @@ bool QgsCoordinateReferenceSystem::sDisableStringCache = false;
#if PROJ_VERSION_MAJOR>=6
QString getFullProjString( PJ *obj )
{
return QString( proj_as_proj_string( QgsProjContext::get(), obj, PJ_PROJ_5, nullptr ) );
// see https://lists.osgeo.org/pipermail/proj/2019-May/008565.html, it's not sufficient to just
// use proj_as_proj_string
QgsProjUtils::proj_pj_unique_ptr boundCrs( proj_crs_create_bound_crs_to_WGS84( QgsProjContext::get(), obj, nullptr ) );
if ( boundCrs )
{
if ( const char *proj4src = proj_as_proj_string( QgsProjContext::get(), boundCrs.get(), PJ_PROJ_4, nullptr ) )
{
return QString( proj4src );
}
}

return QString( proj_as_proj_string( QgsProjContext::get(), obj, PJ_PROJ_4, nullptr ) );
}
#endif
//--------------------------

0 comments on commit 4b5056c

Please sign in to comment.
You can’t perform that action at this time.