Skip to content

Commit

Permalink
Cleanup QgsCoordinateReferenceSystem WKT enum
Browse files Browse the repository at this point in the history
- alias WKT_2018* to new WKT_2019* values, since the spec is actually
2019, not 2018
- add WKT_PREFERRED value which currently aliases to WKT2_2019, but
can be changed if/when future bumps to the WKT spec happen
- add WKT_PREFERRED_GDAL which should be used whenever a CRS is
exported to WKT for use with GDAL API. Aliases to WKT2_2019 currently,
but can be changed if/when a new spec is released and GDAL supports it
  • Loading branch information
nyalldawson committed Apr 23, 2020
1 parent 5d45b71 commit 5b6589f
Show file tree
Hide file tree
Showing 36 changed files with 95 additions and 81 deletions.
Expand Up @@ -718,6 +718,12 @@ Returns the ellipsoid acronym for the ellipsoid used by the CRS.
WKT2_2015_SIMPLIFIED,
WKT2_2018,
WKT2_2018_SIMPLIFIED,
WKT2_2019,
WKT2_2019_SIMPLIFIED,

WKT_PREFERRED,
WKT_PREFERRED_SIMPLIFIED,
WKT_PREFERRED_GDAL,
};

QString toWkt( WktVariant variant = WKT1_GDAL, bool multiline = false, int indentationWidth = 4 ) const;
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/processing/algs/gdal/GdalUtils.py
Expand Up @@ -439,7 +439,7 @@ def gdal_crs_string(crs):

if QgsProjUtils.projVersionMajor() >= 6:
# use WKT
return crs.toWkt(QgsCoordinateReferenceSystem.WKT2_2018)
return crs.toWkt(QgsCoordinateReferenceSystem.WKT_PREFERRED_GDAL)

# fallback to proj4 string, stripping out newline characters
return crs.toProj().replace('\n', ' ').replace('\r', ' ')
2 changes: 1 addition & 1 deletion src/analysis/processing/qgsalgorithmrasterize.cpp
Expand Up @@ -173,7 +173,7 @@ QVariantMap QgsRasterizeAlgorithm::processAlgorithm( const QVariantMap &paramete
throw QgsProcessingException( QObject::tr( "Error creating GDAL output layer" ) );
}

GDALSetProjection( hOutputDataset.get(), context.project()->crs().toWkt( QgsCoordinateReferenceSystem::WKT2_2018 ).toLatin1().constData() );
GDALSetProjection( hOutputDataset.get(), context.project()->crs().toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED_GDAL ).toLatin1().constData() );
double geoTransform[6];
geoTransform[0] = extent.xMinimum();
geoTransform[1] = mapUnitsPerPixel;
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/raster/qgsalignraster.cpp
Expand Up @@ -397,7 +397,7 @@ int QgsAlignRaster::suggestedReferenceLayer() const
// would be a better a choice to more accurately compute areas?
// (Why earth is not flat???)
QgsCoordinateReferenceSystem destCRS( QStringLiteral( "EPSG:4326" ) );
QString destWkt = destCRS.toWkt( QgsCoordinateReferenceSystem::WKT2_2018 );
QString destWkt = destCRS.toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED_GDAL );

const auto constMRasters = mRasters;
for ( const Item &raster : constMRasters )
Expand Down
4 changes: 2 additions & 2 deletions src/analysis/raster/qgsrastercalculator.cpp
Expand Up @@ -153,7 +153,7 @@ QgsRasterCalculator::Result QgsRasterCalculator::processCalculation( QgsFeedback
return CreateOutputError;
}

GDALSetProjection( outputDataset.get(), mOutputCrs.toWkt( QgsCoordinateReferenceSystem::WKT2_2018 ).toLocal8Bit().data() );
GDALSetProjection( outputDataset.get(), mOutputCrs.toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED_GDAL ).toLocal8Bit().data() );
GDALRasterBandH outputRasterBand = GDALGetRasterBand( outputDataset.get(), 1 );

float outputNodataValue = -FLT_MAX;
Expand Down Expand Up @@ -529,7 +529,7 @@ QgsRasterCalculator::Result QgsRasterCalculator::processCalculationGPU( std::uni
return CreateOutputError;
}

GDALSetProjection( outputDataset.get(), mOutputCrs.toWkt( QgsCoordinateReferenceSystem::WKT2_2018 ).toLocal8Bit().data() );
GDALSetProjection( outputDataset.get(), mOutputCrs.toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED_GDAL ).toLocal8Bit().data() );


GDALRasterBandH outputRasterBand = GDALGetRasterBand( outputDataset.get(), 1 );
Expand Down
2 changes: 1 addition & 1 deletion src/app/dwg/qgsdwgimporter.cpp
Expand Up @@ -77,7 +77,7 @@ QgsDwgImporter::QgsDwgImporter( const QString &database, const QgsCoordinateRefe
{
QgsDebugCall;

QString crswkt( crs.toWkt( QgsCoordinateReferenceSystem::WKT2_2018 ) );
QString crswkt( crs.toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED_GDAL ) );
mCrsH = OSRNewSpatialReference( crswkt.toLocal8Bit().constData() );
QgsDebugMsg( QStringLiteral( "CRS %1[%2]: %3" ).arg( mCrs ).arg( ( qint64 ) mCrsH, 0, 16 ).arg( crswkt ) );
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsalignrasterdialog.cpp
Expand Up @@ -196,7 +196,7 @@ void QgsAlignRasterDialog::updateParametersFromReferenceLayer()
{
QgsCoordinateReferenceSystem refCRS( refInfo.crs() );
if ( refCRS != mCrsSelector->crs() )
customCRSWkt = mCrsSelector->crs( ).toWkt( QgsCoordinateReferenceSystem::WKT2_2018 );
customCRSWkt = mCrsSelector->crs( ).toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED_GDAL );
}

if ( mChkCustomCellSize->isChecked() )
Expand Down Expand Up @@ -313,7 +313,7 @@ void QgsAlignRasterDialog::referenceLayerChanged()

void QgsAlignRasterDialog::destinationCrsChanged()
{
if ( mCrsSelector->crs().toWkt( QgsCoordinateReferenceSystem::WKT2_2018 ) == mAlign->destinationCrs() )
if ( mCrsSelector->crs().toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED_GDAL ) == mAlign->destinationCrs() )
return;

int index = mCboReferenceLayer->currentIndex();
Expand Down
20 changes: 10 additions & 10 deletions src/app/qgscustomprojectiondialog.cpp
Expand Up @@ -132,8 +132,8 @@ void QgsCustomProjectionDialog::populateList()
crs.createFromProj( parameters );

mExistingCRSnames[id] = name;
const QString actualWkt = crs.toWkt( QgsCoordinateReferenceSystem::WKT2_2018, false );
const QString actualWktFormatted = crs.toWkt( QgsCoordinateReferenceSystem::WKT2_2018, true );
const QString actualWkt = crs.toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED, false );
const QString actualWktFormatted = crs.toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED, true );
const QString actualProj = crs.toProj();
mExistingCRSwkt[id] = wkt.isEmpty() ? QString() : actualWkt;
mExistingCRSproj[id] = wkt.isEmpty() ? actualProj : QString();
Expand Down Expand Up @@ -273,7 +273,7 @@ bool QgsCustomProjectionDialog::saveCrs( QgsCoordinateReferenceSystem crs, const
+ ",ellipsoid_acronym=" + ( !ellipsoidAcronym.isEmpty() ? QgsSqliteUtils::quotedString( ellipsoidAcronym ) : QStringLiteral( "''" ) )
+ ",parameters=" + ( !crs.toProj().isEmpty() ? QgsSqliteUtils::quotedString( crs.toProj() ) : QStringLiteral( "''" ) )
+ ",is_geo=0" // <--shamelessly hard coded for now
+ ",wkt=" + ( format == QgsCoordinateReferenceSystem::FormatWkt ? QgsSqliteUtils::quotedString( crs.toWkt( QgsCoordinateReferenceSystem::WKT2_2018, false ) ) : QStringLiteral( "''" ) )
+ ",wkt=" + ( format == QgsCoordinateReferenceSystem::FormatWkt ? QgsSqliteUtils::quotedString( crs.toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED, false ) ) : QStringLiteral( "''" ) )
+ " where srs_id=" + QgsSqliteUtils::quotedString( id )
;
QgsDebugMsgLevel( sql, 4 );
Expand All @@ -298,7 +298,7 @@ bool QgsCustomProjectionDialog::saveCrs( QgsCoordinateReferenceSystem crs, const
if ( result != SQLITE_OK )
return false;
}
mExistingCRSwkt[id] = format == QgsCoordinateReferenceSystem::FormatWkt ? crs.toWkt( QgsCoordinateReferenceSystem::WKT2_2018, false ) : QString();
mExistingCRSwkt[id] = format == QgsCoordinateReferenceSystem::FormatWkt ? crs.toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED, false ) : QString();
mExistingCRSproj[id] = format == QgsCoordinateReferenceSystem::FormatProj ? crs.toProj() : QString();
mExistingCRSnames[id] = name;

Expand Down Expand Up @@ -426,12 +426,12 @@ void QgsCustomProjectionDialog::pbnCopyCRS_clicked()
}

whileBlocking( mFormatComboBox )->setCurrentIndex( mFormatComboBox->findData( static_cast< int >( QgsCoordinateReferenceSystem::FormatWkt ) ) );
teParameters->setPlainText( srs.toWkt( QgsCoordinateReferenceSystem::WKT2_2018, true ) );
mDefinitions[leNameList->currentIndex().row()].wkt = srs.toWkt( QgsCoordinateReferenceSystem::WKT2_2018, false );
teParameters->setPlainText( srs.toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED, true ) );
mDefinitions[leNameList->currentIndex().row()].wkt = srs.toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED, false );
mDefinitions[leNameList->currentIndex().row()].proj.clear();

leNameList->currentItem()->setText( QgisCrsParametersColumn, srs.toWkt( QgsCoordinateReferenceSystem::WKT2_2018, false ) );
leNameList->currentItem()->setData( 0, FormattedWktRole, srs.toWkt( QgsCoordinateReferenceSystem::WKT2_2018, true ) );
leNameList->currentItem()->setText( QgisCrsParametersColumn, srs.toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED, false ) );
leNameList->currentItem()->setData( 0, FormattedWktRole, srs.toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED, true ) );
}
}

Expand Down Expand Up @@ -491,7 +491,7 @@ void QgsCustomProjectionDialog::buttonBox_accepted()
{
ref = QStringLiteral( "ID[\"%1\",%2]" ).arg( authparts.at( 0 ), authparts.at( 1 ) );
}
if ( !ref.isEmpty() && crs.toWkt( QgsCoordinateReferenceSystem::WKT2_2018 ).contains( ref ) )
if ( !ref.isEmpty() && crs.toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED ).contains( ref ) )
{
QMessageBox::warning( this, tr( "Custom Coordinate Reference System" ),
tr( "Cannot save '%1' — the definition is equivalent to %2.\n\n(Try removing \"%3\" from the WKT definition.)" ).arg( def.name, crs.authid(), ref ) );
Expand Down Expand Up @@ -727,7 +727,7 @@ void QgsCustomProjectionDialog::formatChanged()
{
const QByteArray multiLineOption = QStringLiteral( "MULTILINE=YES" ).toLocal8Bit();
const char *const options[] = {multiLineOption.constData(), nullptr};
newFormatString = QString( proj_as_wkt( pjContext, crs.get(), PJ_WKT2_2018, options ) );
newFormatString = QString( proj_as_wkt( pjContext, crs.get(), PJ_WKT2_2019, options ) );
}
}
#else
Expand Down
2 changes: 1 addition & 1 deletion src/core/expression/qgsexpressioncontextutils.cpp
Expand Up @@ -391,7 +391,7 @@ QgsExpressionContextScope *QgsExpressionContextUtils::mapSettingsScope( const Qg
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_crs_acronym" ), mapSettings.destinationCrs().projectionAcronym(), true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_crs_ellipsoid" ), mapSettings.destinationCrs().ellipsoidAcronym(), true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_crs_proj4" ), mapSettings.destinationCrs().toProj(), true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_crs_wkt" ), mapSettings.destinationCrs().toWkt( QgsCoordinateReferenceSystem::WKT2_2018 ), true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_crs_wkt" ), mapSettings.destinationCrs().toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED ), true ) );

// IMPORTANT: ANY CHANGES HERE ALSO NEED TO BE MADE TO QgsLayoutItemMap::createExpressionContext()
// (rationale is described in QgsLayoutItemMap::createExpressionContext() )
Expand Down
2 changes: 1 addition & 1 deletion src/core/layout/qgslayoutexporter.cpp
Expand Up @@ -1592,7 +1592,7 @@ bool QgsLayoutExporter::georeferenceOutputPrivate( const QString &file, QgsLayou
}

if ( t )
GDALSetProjection( outputDS.get(), map->crs().toWkt( QgsCoordinateReferenceSystem::WKT2_2018 ).toLocal8Bit().constData() );
GDALSetProjection( outputDS.get(), map->crs().toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED_GDAL ).toLocal8Bit().constData() );
}
CPLSetConfigOption( "GDAL_PDF_DPI", nullptr );

Expand Down
2 changes: 1 addition & 1 deletion src/core/layout/qgslayoutitemmap.cpp
Expand Up @@ -1535,7 +1535,7 @@ QgsExpressionContext QgsLayoutItemMap::createExpressionContext() const
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_crs_acronym" ), mapCrs.projectionAcronym(), true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_crs_ellipsoid" ), mapCrs.ellipsoidAcronym(), true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_crs_proj4" ), mapCrs.toProj(), true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_crs_wkt" ), mapCrs.toWkt( QgsCoordinateReferenceSystem::WKT2_2018 ), true ) );
scope->addVariable( QgsExpressionContextScope::StaticVariable( QStringLiteral( "map_crs_wkt" ), mapCrs.toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED ), true ) );

QVariantList layersIds;
QVariantList layers;
Expand Down
2 changes: 1 addition & 1 deletion src/core/providers/gdal/qgsgdaldataitems.cpp
Expand Up @@ -61,7 +61,7 @@ bool QgsGdalLayerItem::setCrs( const QgsCoordinateReferenceSystem &crs )
if ( !hDS )
return false;

QString wkt = crs.toWkt( QgsCoordinateReferenceSystem::WKT2_2018 );
QString wkt = crs.toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED_GDAL );
if ( GDALSetProjection( hDS.get(), wkt.toLocal8Bit().data() ) != CE_None )
{
QgsDebugMsg( QStringLiteral( "Could not set CRS" ) );
Expand Down
2 changes: 1 addition & 1 deletion src/core/providers/gdal/qgsgdalprovider.cpp
Expand Up @@ -2951,7 +2951,7 @@ QgsGdalProvider *QgsGdalProviderMetadata::createRasterDataProvider(
}

GDALSetGeoTransform( dataset.get(), geoTransform );
GDALSetProjection( dataset.get(), crs.toWkt( QgsCoordinateReferenceSystem::WKT2_2018 ).toLocal8Bit().data() );
GDALSetProjection( dataset.get(), crs.toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED_GDAL ).toLocal8Bit().data() );

QgsDataProvider::ProviderOptions providerOptions;
return new QgsGdalProvider( uri, providerOptions, true, dataset.release() );
Expand Down
2 changes: 1 addition & 1 deletion src/core/providers/memory/qgsmemoryprovider.cpp
Expand Up @@ -256,7 +256,7 @@ QString QgsMemoryProvider::dataSourceUri( bool expandAuthConfig ) const
}
else
{
crsDef = QStringLiteral( "wkt:%1" ).arg( mCrs.toWkt( QgsCoordinateReferenceSystem::WKT2_2018 ) );
crsDef = QStringLiteral( "wkt:%1" ).arg( mCrs.toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED ) );
}
query.addQueryItem( QStringLiteral( "crs" ), crsDef );
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -3543,7 +3543,7 @@ bool QgsOgrProviderUtils::createEmptyDataSource( const QString &uri,
mySpatialRefSys.validate();
}

QString myWkt = mySpatialRefSys.toWkt( QgsCoordinateReferenceSystem::WKT2_2018 );
QString myWkt = mySpatialRefSys.toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED_GDAL );

if ( !myWkt.isNull() && myWkt.length() != 0 )
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsabstractgeopdfexporter.cpp
Expand Up @@ -394,7 +394,7 @@ QString QgsAbstractGeoPdfExporter::createCompositionXml( const QList<ComponentLa
}
else
{
srs.appendChild( doc.createTextNode( section.crs.toWkt( QgsCoordinateReferenceSystem::WKT2_2018 ) ) );
srs.appendChild( doc.createTextNode( section.crs.toWkt( QgsCoordinateReferenceSystem::WKT_PREFERRED_GDAL ) ) );
}
georeferencing.appendChild( srs );
}
Expand Down
24 changes: 12 additions & 12 deletions src/core/qgscoordinatereferencesystem.cpp
Expand Up @@ -1296,10 +1296,10 @@ QString QgsCoordinateReferenceSystem::userFriendlyIdentifier( IdentifierType typ
return description();
else if ( type == ShortString )
return QObject::tr( "Unknown CRS" );
else if ( !toWkt( WKT2_2018 ).isEmpty() )
else if ( !toWkt( WKT_PREFERRED ).isEmpty() )
return QObject::tr( "Unknown CRS: %1" ).arg(
type == MediumString ? ( toWkt( WKT2_2018 ).left( 50 ) + QString( QChar( 0x2026 ) ) )
: toWkt( WKT2_2018 ) );
type == MediumString ? ( toWkt( WKT_PREFERRED ).left( 50 ) + QString( QChar( 0x2026 ) ) )
: toWkt( WKT_PREFERRED ) );
else if ( !toProj().isEmpty() )
return QObject::tr( "Unknown CRS: %1" ).arg( type == MediumString ? ( toProj().left( 50 ) + QString( QChar( 0x2026 ) ) )
: toProj() );
Expand Down Expand Up @@ -1889,7 +1889,7 @@ bool QgsCoordinateReferenceSystem::operator==( const QgsCoordinateReferenceSyste
if ( ( !d->mAuthId.isEmpty() || !srs.d->mAuthId.isEmpty() ) )
return d->mAuthId == srs.d->mAuthId;

return toWkt( WKT2_2018 ) == srs.toWkt( WKT2_2018 );
return toWkt( WKT_PREFERRED ) == srs.toWkt( WKT_PREFERRED );
}

bool QgsCoordinateReferenceSystem::operator!=( const QgsCoordinateReferenceSystem &srs ) const
Expand Down Expand Up @@ -1917,11 +1917,11 @@ QString QgsCoordinateReferenceSystem::toWkt( WktVariant variant, bool multiline,
case WKT2_2015_SIMPLIFIED:
type = PJ_WKT2_2015_SIMPLIFIED;
break;
case WKT2_2018:
type = PJ_WKT2_2018;
case WKT2_2019:
type = PJ_WKT2_2019;
break;
case WKT2_2018_SIMPLIFIED:
type = PJ_WKT2_2018_SIMPLIFIED;
case WKT2_2019_SIMPLIFIED:
type = PJ_WKT2_2019_SIMPLIFIED;
break;
}

Expand Down Expand Up @@ -2049,7 +2049,7 @@ bool QgsCoordinateReferenceSystem::writeXml( QDomNode &node, QDomDocument &doc )
QDomElement srsElement = doc.createElement( QStringLiteral( "spatialrefsys" ) );

QDomElement wktElement = doc.createElement( QStringLiteral( "wkt" ) );
wktElement.appendChild( doc.createTextNode( toWkt( WKT2_2018 ) ) );
wktElement.appendChild( doc.createTextNode( toWkt( WKT_PREFERRED ) ) );
srsElement.appendChild( wktElement );

QDomElement proj4Element = doc.createElement( QStringLiteral( "proj4" ) );
Expand Down Expand Up @@ -2189,7 +2189,7 @@ void QgsCoordinateReferenceSystem::debugPrint()
QgsDebugMsg( "* Valid : " + ( d->mIsValid ? QString( "true" ) : QString( "false" ) ) );
QgsDebugMsg( "* SrsId : " + QString::number( d->mSrsId ) );
QgsDebugMsg( "* Proj4 : " + toProj() );
QgsDebugMsg( "* WKT : " + toWkt( WKT2_2018 ) );
QgsDebugMsg( "* WKT : " + toWkt( WKT_PREFERRED ) );
QgsDebugMsg( "* Desc. : " + d->mDescription );
if ( mapUnits() == QgsUnitTypes::DistanceMeters )
{
Expand Down Expand Up @@ -2233,7 +2233,7 @@ long QgsCoordinateReferenceSystem::saveAsUserCrs( const QString &name, Format na
{
proj4String = toProj();
}
QString wktString = toWkt( WKT2_2018 );
QString wktString = toWkt( WKT_PREFERRED );

// ellipsoid acroynym column is incorrectly marked as not null in many crs database instances,
// hack around this by using an empty string instead
Expand Down Expand Up @@ -3565,7 +3565,7 @@ void QgsCoordinateReferenceSystem::pushRecentCoordinateReferenceSystem( const Qg
{
authids << c.authid();
proj << c.toProj();
wkt << c.toWkt( WKT2_2018 );
wkt << c.toWkt( WKT_PREFERRED );
}

QgsSettings settings;
Expand Down
10 changes: 8 additions & 2 deletions src/core/qgscoordinatereferencesystem.h
Expand Up @@ -664,8 +664,14 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
WKT1_ESRI, //!< WKT1 as traditionally output by ESRI software, deriving from OGC 99-049.
WKT2_2015, //!< Full WKT2 string, conforming to ISO 19162:2015(E) / OGC 12-063r5 with all possible nodes and new keyword names.
WKT2_2015_SIMPLIFIED, //!< Same as WKT2_2015 with the following exceptions: UNIT keyword used. ID node only on top element. No ORDER element in AXIS element. PRIMEM node omitted if it is Greenwich. ELLIPSOID.UNIT node omitted if it is UnitOfMeasure::METRE. PARAMETER.UNIT / PRIMEM.UNIT omitted if same as AXIS. AXIS.UNIT omitted and replaced by a common GEODCRS.UNIT if they are all the same on all axis.
WKT2_2018, //!< Full WKT2 string, conforming to ISO 19162:2018 / OGC 18-010, with all possible nodes and new keyword names. Non-normative list of differences: WKT2_2018 uses GEOGCRS / BASEGEOGCRS keywords for GeographicCRS.
WKT2_2018_SIMPLIFIED, //!< WKT2_2018 with the simplification rule of WKT2_SIMPLIFIED
WKT2_2018, //!< Alias for WKT2_2019
WKT2_2018_SIMPLIFIED, //!< Alias for WKT2_2019_SIMPLIFIED
WKT2_2019 = WKT2_2018, //!< Full WKT2 string, conforming to ISO 19162:2019 / OGC 18-010, with all possible nodes and new keyword names. Non-normative list of differences: WKT2_2019 uses GEOGCRS / BASEGEOGCRS keywords for GeographicCRS.
WKT2_2019_SIMPLIFIED = WKT2_2018_SIMPLIFIED, //!< WKT2_2019 with the simplification rule of WKT2_SIMPLIFIED

WKT_PREFERRED = WKT2_2019, //!< Preferred format, matching the most recent WKT ISO standard. Currently an alias to WKT2_2019, but may change in future versions.
WKT_PREFERRED_SIMPLIFIED = WKT2_2019_SIMPLIFIED, //!< Preferred simplified format, matching the most recent WKT ISO standard. Currently an alias to WKT2_2019_SIMPLIFIED, but may change in future versions.
WKT_PREFERRED_GDAL = WKT2_2019, //!< Preferred format for conversion of CRS to WKT for use with the GDAL library.
};

/**
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgscoordinatereferencesystem_p.h
Expand Up @@ -178,6 +178,8 @@ class QgsCoordinateReferenceSystemPrivate : public QSharedData

mutable QString mProj4;

mutable QString mWkt

//! True if presence of an inverted axis needs to be recalculated
mutable bool mAxisInvertedDirty = false;

Expand Down

0 comments on commit 5b6589f

Please sign in to comment.