Skip to content
Permalink
Browse files

More user of userFriendlyIdentifier

  • Loading branch information
nyalldawson committed Dec 18, 2019
1 parent fdf211a commit 403e79e4219de3936c5b42c6c763d3bc486d12bc
@@ -268,7 +268,7 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanv
metadataFrame->setLayout( layout );

QgsDebugMsg( "Setting crs to " + mRasterLayer->crs().toWkt() );
QgsDebugMsg( "Setting crs to " + mRasterLayer->crs().authid() + " - " + mRasterLayer->crs().description() );
QgsDebugMsg( "Setting crs to " + mRasterLayer->crs().userFriendlyIdentifier() );
mCrsSelector->setCrs( mRasterLayer->crs() );

// Set text for pyramid info box
@@ -51,8 +51,8 @@ QgsTemplateProjectsModel::QgsTemplateProjectsModel( QObject *parent )
QStandardItem *emptyProjectItem = new QStandardItem();

emptyProjectItem->setData( tr( "New Empty Project" ), QgsProjectListItemDelegate::TitleRole );
connect( QgsProject::instance(), &QgsProject::crsChanged, this, [emptyProjectItem]() { emptyProjectItem->setData( QgsProject::instance()->crs().description(), QgsProjectListItemDelegate::CrsRole ); } );
emptyProjectItem->setData( QgsProject::instance()->crs().description(), QgsProjectListItemDelegate::CrsRole );
connect( QgsProject::instance(), &QgsProject::crsChanged, this, [emptyProjectItem]() { emptyProjectItem->setData( QgsProject::instance()->crs().userFriendlyIdentifier(), QgsProjectListItemDelegate::CrsRole ); } );
emptyProjectItem->setData( QgsProject::instance()->crs().userFriendlyIdentifier(), QgsProjectListItemDelegate::CrsRole );
emptyProjectItem->setFlags( Qt::ItemFlag::ItemIsSelectable | Qt::ItemFlag::ItemIsEnabled ) ;
QSize previewSize( 250, 177 );
QImage image( previewSize, QImage::Format_ARGB32 );
@@ -118,8 +118,7 @@ QString QgsLayerMetadataFormatter::extentSectionHtml( const bool showSpatialExte
myMetadata += QStringLiteral( "<tr><td class=\"highlight\">" ) + tr( "CRS" ) + QStringLiteral( "</td><td>" );
if ( mMetadata.crs().isValid() )
{
myMetadata += mMetadata.crs().authid() + QStringLiteral( " - " );
myMetadata += mMetadata.crs().description() + QStringLiteral( " - " );
myMetadata += mMetadata.crs().userFriendlyIdentifier() + QStringLiteral( " - " );
if ( mMetadata.crs().isGeographic() )
myMetadata += tr( "Geographic" );
else
@@ -135,8 +134,7 @@ QString QgsLayerMetadataFormatter::extentSectionHtml( const bool showSpatialExte
{
myMetadata += QLatin1String( "<br />\n" );
}
myMetadata += QStringLiteral( "<strong>" ) + tr( "CRS" ) + QStringLiteral( ": </strong>" ) + spatialExtent.extentCrs.authid() + QStringLiteral( " - " );
myMetadata += spatialExtent.extentCrs.description() + QStringLiteral( " - " );
myMetadata += QStringLiteral( "<strong>" ) + tr( "CRS" ) + QStringLiteral( ": </strong>" ) + spatialExtent.extentCrs.userFriendlyIdentifier() + QStringLiteral( " - " );
if ( spatialExtent.extentCrs.isGeographic() )
myMetadata += tr( "Geographic" );
else
@@ -4758,8 +4758,7 @@ QString QgsVectorLayer::htmlMetadata() const
myMetadata += QStringLiteral( "<tr><td class=\"highlight\">" ) + tr( "CRS" ) + QStringLiteral( "</td><td>" );
if ( crs().isValid() )
{
myMetadata += crs().authid() + QStringLiteral( " - " );
myMetadata += crs().description() + QStringLiteral( " - " );
myMetadata += crs().userFriendlyIdentifier() + QStringLiteral( " - " );
if ( crs().isGeographic() )
myMetadata += tr( "Geographic" );
else
@@ -323,8 +323,7 @@ QString QgsRasterLayer::htmlMetadata() const
myMetadata += QStringLiteral( "<tr><td class=\"highlight\">" ) % tr( "CRS" ) + QStringLiteral( "</td><td>" );
if ( crs().isValid() )
{
myMetadata += crs().authid() % QStringLiteral( " - " ) %
crs().description() + QStringLiteral( " - " );
myMetadata += crs().userFriendlyIdentifier() % QStringLiteral( " - " );
if ( crs().isGeographic() )
myMetadata += tr( "Geographic" );
else
@@ -304,7 +304,7 @@ void QgsMetadataWidget::crsChanged()
{
if ( ( mCrs.isValid() ) && ( mLayer ) )
{
lblCurrentCrs->setText( tr( "CRS: %1 - %2" ).arg( mCrs.authid(), mCrs.description() ) );
lblCurrentCrs->setText( tr( "CRS: %1" ).arg( mCrs.userFriendlyIdentifier() ) );
spatialExtentSelector->setEnabled( true );
spatialExtentSelector->setOutputCrs( mCrs );

@@ -1030,7 +1030,7 @@ bool QgsWcsCapabilities::parseDescribeCoverageDom11( QByteArray const &xml, QgsW
box = QgsRectangle( low[0], low[1], high[0], high[1] );
}
coverage->boundingBoxes.insert( authid, box );
QgsDebugMsg( "crs: " + crs.authid() + ' ' + crs.description() + QString( " axisInverted = %1" ).arg( crs.hasAxisInverted() ) );
QgsDebugMsg( "crs: " + crs.userFriendlyIdentifier() + QString( " axisInverted = %1" ).arg( crs.hasAxisInverted() ) );
QgsDebugMsg( "BoundingBox: " + authid + " : " + box.toString() );
}
}
@@ -565,7 +565,7 @@ bool QgsWcsProvider::readBlock( int bandNo, QgsRectangle const &viewExtent, int
{
QgsDebugMsg( QStringLiteral( "Cached does not have CRS" ) );
}
QgsDebugMsg( "Cache CRS: " + cacheCrs.authid() + ' ' + cacheCrs.description() );
QgsDebugMsg( "Cache CRS: " + cacheCrs.userFriendlyIdentifier() );

QgsRectangle cacheExtent = QgsGdalProviderBase::extent( mCachedGdalDataset.get() );
QgsDebugMsg( "viewExtent = " + viewExtent.toString() );
@@ -1174,7 +1174,7 @@ bool QgsWcsProvider::calculateExtent() const
{
QgsDebugMsg( QStringLiteral( "Cached does not have CRS" ) );
}
QgsDebugMsg( "Cache CRS: " + cacheCrs.authid() + ' ' + cacheCrs.description() );
QgsDebugMsg( "Cache CRS: " + cacheCrs.userFriendlyIdentifier() );

// We can only verify extent if CRS is set
// If dataset comes rotated, GDAL probably cuts latitude extend, disable
@@ -2951,7 +2951,7 @@ QgsRasterIdentifyResult QgsWmsProvider::identify( const QgsPointXY &point, QgsRa
// for results -> verify CRS and reprojects if necessary
QMap<QgsFeatureId, QgsFeature * > features = gml.featuresMap();
QgsCoordinateReferenceSystem featuresCrs = gml.crs();
QgsDebugMsg( QStringLiteral( "%1 features read, crs: %2 %3" ).arg( features.size() ).arg( featuresCrs.authid(), featuresCrs.description() ) );
QgsDebugMsg( QStringLiteral( "%1 features read, crs: %2" ).arg( features.size() ).arg( featuresCrs.userFriendlyIdentifier() ) );
QgsCoordinateTransform coordinateTransform;
if ( featuresCrs.isValid() && featuresCrs != crs() )
{
@@ -1109,8 +1109,8 @@ QString QgsWMSSourceSelect::descriptionForAuthId( const QString &authId )
return mCrsNames[ authId ];

QgsCoordinateReferenceSystem qgisSrs = QgsCoordinateReferenceSystem::fromOgcWmsCrs( authId );
mCrsNames.insert( authId, qgisSrs.description() );
return qgisSrs.description();
mCrsNames.insert( authId, qgisSrs.userFriendlyIdentifier() );
return qgisSrs.userFriendlyIdentifier();
}

void QgsWMSSourceSelect::addDefaultServers()

0 comments on commit 403e79e

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