Skip to content
Permalink
Browse files

Fix crs export to wkt on proj 6

  • Loading branch information
nyalldawson committed Apr 8, 2019
1 parent aa21d55 commit 3bab21dc1b648948475643402b7c8f55baff4190
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/core/qgscoordinatereferencesystem.cpp
@@ -1369,12 +1369,21 @@ QString QgsCoordinateReferenceSystem::toWkt() const
{
if ( d->mWkt.isEmpty() )
{
#if PROJ_VERSION_MAJOR>=6
// TODO QGIS 4.0 - upgrade to wkt2 (this would be an API break).
if ( d->mPj )
{
const char *const options[] = {"MULTILINE=NO", "INDENTATION_WIDTH=0", nullptr};
d->mWkt = QString( proj_as_wkt( QgsProjContext::get(), d->mPj.get(), PJ_WKT1_GDAL, options ) );
}
#else
char *wkt = nullptr;
if ( OSRExportToWkt( d->mCRS, &wkt ) == OGRERR_NONE )
{
d->mWkt = wkt;
CPLFree( wkt );
}
#endif
}
return d->mWkt;
}

0 comments on commit 3bab21d

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