Skip to content
Permalink
Browse files

fix warnings

  • Loading branch information
jef-n committed Mar 20, 2016
1 parent bd3fd74 commit 5769f3b8617f035a2da25c4c3f5605bb54ba59c7
@@ -140,7 +140,9 @@ int QgsNineCellFilter::processRaster( QProgressDialog* p )
scanLine1[a] = mInputNodataValue;
}
if ( GDALRasterIO( rasterBand, GF_Read, 0, 0, xSize, 1, scanLine2, xSize, 1, GDT_Float32, 0, 0 ) != CE_None )
{
QgsDebugMsg( "Raster IO Error" );
}
}
else
{
@@ -161,7 +163,9 @@ int QgsNineCellFilter::processRaster( QProgressDialog* p )
else
{
if ( GDALRasterIO( rasterBand, GF_Read, 0, i + 1, xSize, 1, scanLine3, xSize, 1, GDT_Float32, 0, 0 ) != CE_None )
{
QgsDebugMsg( "Raster IO Error" );
}
}

for ( int j = 0; j < xSize; ++j )
@@ -184,7 +188,9 @@ int QgsNineCellFilter::processRaster( QProgressDialog* p )
}

if ( GDALRasterIO( outputRasterBand, GF_Write, 0, i, xSize, 1, resultLine, xSize, 1, GDT_Float32, 0, 0 ) != CE_None )
{
QgsDebugMsg( "Raster IO Error" );
}
}

if ( p )
@@ -204,7 +204,9 @@ int QgsRelief::processRaster( QProgressDialog* p )
scanLine1[a] = mInputNodataValue;
}
if ( GDALRasterIO( rasterBand, GF_Read, 0, 0, xSize, 1, scanLine2, xSize, 1, GDT_Float32, 0, 0 ) != CE_None )
{
QgsDebugMsg( "Raster IO Error" );
}
}
else
{
@@ -225,7 +227,9 @@ int QgsRelief::processRaster( QProgressDialog* p )
else
{
if ( GDALRasterIO( rasterBand, GF_Read, 0, i + 1, xSize, 1, scanLine3, xSize, 1, GDT_Float32, 0, 0 ) != CE_None )
{
QgsDebugMsg( "Raster IO Error" );
}
}

for ( int j = 0; j < xSize; ++j )
@@ -258,11 +262,17 @@ int QgsRelief::processRaster( QProgressDialog* p )
}

if ( GDALRasterIO( outputRedBand, GF_Write, 0, i, xSize, 1, resultRedLine, xSize, 1, GDT_Byte, 0, 0 ) != CE_None )
{
QgsDebugMsg( "Raster IO Error" );
}
if ( GDALRasterIO( outputGreenBand, GF_Write, 0, i, xSize, 1, resultGreenLine, xSize, 1, GDT_Byte, 0, 0 ) != CE_None )
{
QgsDebugMsg( "Raster IO Error" );
}
if ( GDALRasterIO( outputBlueBand, GF_Write, 0, i, xSize, 1, resultBlueLine, xSize, 1, GDT_Byte, 0, 0 ) != CE_None )
{
QgsDebugMsg( "Raster IO Error" );
}
}

if ( p )
@@ -483,7 +483,9 @@ void QgsZonalStatistics::statisticsFromPreciseIntersection( void* band, const Qg
for ( int col = 0; col < nCellsX; ++col )
{
if ( GDALRasterIO( band, GF_Read, pixelOffsetX + col, pixelOffsetY + row, nCellsX, 1, pixelData, 1, 1, GDT_Float32, 0, 0 ) != CE_None )
{
QgsDebugMsg( "Raster IO Error" );
}

if ( !validPixel( *pixelData ) )
continue;
@@ -171,7 +171,9 @@ void Heatmap::run()
for ( int i = 0; i < rows ; i++ )
{
if ( poBand->RasterIO( GF_Write, 0, i, columns, 1, line, columns, 1, GDT_Float32, 0, 0 ) != CE_None )
{
QgsDebugMsg( "Raster IO Error" );
}
}

CPLFree( line );
@@ -302,7 +304,9 @@ void Heatmap::run()
float *dataBuffer = ( float * ) CPLMalloc( sizeof( float ) * blockSize * blockSize );
if ( poBand->RasterIO( GF_Read, xPosition, yPosition, blockSize, blockSize,
dataBuffer, blockSize, blockSize, GDT_Float32, 0, 0 ) != CE_None )
{
QgsDebugMsg( "Raster IO Error" );
}

for ( int xp = 0; xp <= myBuffer; xp++ )
{
@@ -345,7 +349,9 @@ void Heatmap::run()
}
if ( poBand->RasterIO( GF_Write, xPosition, yPosition, blockSize, blockSize,
dataBuffer, blockSize, blockSize, GDT_Float32, 0, 0 ) != CE_None )
{
QgsDebugMsg( "Raster IO Error" );
}
CPLFree( dataBuffer );
}
}
@@ -341,11 +341,13 @@ QgsWcsProvider::QgsWcsProvider( QString const &uri )
#endif
mGdalDataType.append( myGdalDataType );

#if 0
// TODO: what to do if null values from DescribeCoverage differ?
//if ( !mCoverageSummary.nullValues.contains( myNoDataValue ) )
//{
// QgsDebugMsg( QString( "noDataValue %1 is missing in nullValues from CoverageDescription" ).arg( myNoDataValue ) );
//}
if ( !mCoverageSummary.nullValues.contains( myNoDataValue ) )
{
QgsDebugMsg( QString( "noDataValue %1 is missing in nullValues from CoverageDescription" ).arg( myNoDataValue ) );
}
#endif

QgsDebugMsg( QString( "mSrcGdalDataType[%1] = %2" ).arg( i - 1 ).arg( mSrcGdalDataType.at( i - 1 ) ) );
QgsDebugMsg( QString( "mGdalDataType[%1] = %2" ).arg( i - 1 ).arg( mGdalDataType.at( i - 1 ) ) );
@@ -588,7 +590,9 @@ void QgsWcsProvider::readBlock( int bandNo, QgsRectangle const & viewExtent, in
return;
}
if ( GDALRasterIO( gdalBand, GF_Read, 0, 0, width, height, tmpData, width, height, ( GDALDataType ) mGdalDataType.at( bandNo - 1 ), 0, 0 ) != CE_None )
{
QgsDebugMsg( "Raster IO Error" );
}
for ( int i = 0; i < pixelHeight; i++ )
{
for ( int j = 0; j < pixelWidth; j++ )
@@ -603,15 +607,21 @@ void QgsWcsProvider::readBlock( int bandNo, QgsRectangle const & viewExtent, in
else if ( width == pixelWidth && height == pixelHeight )
{
if ( GDALRasterIO( gdalBand, GF_Read, 0, 0, pixelWidth, pixelHeight, block, pixelWidth, pixelHeight, ( GDALDataType ) mGdalDataType.at( bandNo - 1 ), 0, 0 ) != CE_None )
{
QgsDebugMsg( "Raster IO Error" );
}
else
{
QgsDebugMsg( "Block read OK" );
}
}
else
{
// This should not happen, but it is better to give distorted result + warning
if ( GDALRasterIO( gdalBand, GF_Read, 0, 0, width, height, block, pixelWidth, pixelHeight, ( GDALDataType ) mGdalDataType.at( bandNo - 1 ), 0, 0 ) != CE_None )
{
QgsDebugMsg( "Raster IO Error" );
}
QgsMessageLog::logMessage( tr( "Received coverage has wrong size %1 x %2 (expected %3 x %4)" ).arg( width ).arg( height ).arg( pixelWidth ).arg( pixelHeight ), tr( "WCS" ) );
}
}

0 comments on commit 5769f3b

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