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

(cherry picked from commit 4b5056c)
  • Loading branch information
nyalldawson committed Dec 18, 2019
1 parent 426acfa commit 0c6628d6d62e94573116da37751d8b1000fdb115
Showing with 12 additions and 1 deletion.
  1. +12 −1 src/core/qgscoordinatereferencesystem.cpp
@@ -89,7 +89,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 0c6628d

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