Skip to content
Permalink
Browse files

Less noisy identify method

  • Loading branch information
nyalldawson committed Jul 12, 2018
1 parent f060566 commit daa73910c4e6b82e8be77ef138190af61ed457ef
Showing with 6 additions and 6 deletions.
  1. +2 −2 src/core/raster/qgsrasterdataprovider.cpp
  2. +4 −4 src/providers/gdal/qgsgdalprovider.cpp
@@ -237,12 +237,12 @@ QString QgsRasterDataProvider::htmlMetadata()
// Default implementation for values
QgsRasterIdentifyResult QgsRasterDataProvider::identify( const QgsPointXY &point, QgsRaster::IdentifyFormat format, const QgsRectangle &boundingBox, int width, int height, int /*dpi*/ )
{
QgsDebugMsgLevel( "Entered", 4 );
QgsDebugMsgLevel( QStringLiteral( "Entered" ), 4 );
QMap<int, QVariant> results;

if ( format != QgsRaster::IdentifyFormatValue || !( capabilities() & IdentifyValue ) )
{
QgsDebugMsg( "Format not supported" );
QgsDebugMsg( QStringLiteral( "Format not supported" ) );
return QgsRasterIdentifyResult( ERR( tr( "Format not supported" ) ) );
}

@@ -1002,7 +1002,7 @@ QgsRasterIdentifyResult QgsGdalProvider::identify( const QgsPointXY &point, QgsR
if ( !initIfNeeded() )
return QgsRasterIdentifyResult( ERR( tr( "Cannot read data" ) ) );

QgsDebugMsg( QString( "thePoint = %1 %2" ).arg( point.x(), 0, 'g', 10 ).arg( point.y(), 0, 'g', 10 ) );
QgsDebugMsgLevel( QStringLiteral( "thePoint = %1 %2" ).arg( point.x(), 0, 'g', 10 ).arg( point.y(), 0, 'g', 10 ), 3 );

QMap<int, QVariant> results;

@@ -1024,12 +1024,12 @@ QgsRasterIdentifyResult QgsGdalProvider::identify( const QgsPointXY &point, QgsR
QgsRectangle finalExtent = boundingBox;
if ( finalExtent.isEmpty() ) finalExtent = extent();

QgsDebugMsg( "myExtent = " + finalExtent.toString() );
QgsDebugMsgLevel( QStringLiteral( "myExtent = %1 " ).arg( finalExtent.toString() ), 3 );

if ( width == 0 ) width = xSize();
if ( height == 0 ) height = ySize();

QgsDebugMsg( QString( "theWidth = %1 height = %2" ).arg( width ).arg( height ) );
QgsDebugMsgLevel( QStringLiteral( "theWidth = %1 height = %2" ).arg( width ).arg( height ), 3 );

// Calculate the row / column where the point falls
double xres = ( finalExtent.width() ) / width;
@@ -1039,7 +1039,7 @@ QgsRasterIdentifyResult QgsGdalProvider::identify( const QgsPointXY &point, QgsR
int col = ( int ) std::floor( ( point.x() - finalExtent.xMinimum() ) / xres );
int row = ( int ) std::floor( ( finalExtent.yMaximum() - point.y() ) / yres );

QgsDebugMsg( QString( "row = %1 col = %2" ).arg( row ).arg( col ) );
QgsDebugMsgLevel( QStringLiteral( "row = %1 col = %2" ).arg( row ).arg( col ), 3 );

// QgsDebugMsg( "row = " + QString::number( row ) + " col = " + QString::number( col ) );

0 comments on commit daa7391

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