Skip to content

Commit

Permalink
Revert "Don't automatically create boundcrs proj string representatio…
Browse files Browse the repository at this point in the history
…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 20, 2019
1 parent 426acfa commit 0c6628d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/core/qgscoordinatereferencesystem.cpp
Expand Up @@ -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
//--------------------------
Expand Down

0 comments on commit 0c6628d

Please sign in to comment.