Skip to content

Commit

Permalink
Fix build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jul 26, 2016
1 parent da3ca92 commit 995967a
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/analysis/raster/qgsninecellfilter.cpp
Expand Up @@ -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
{
Expand All @@ -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 )
Expand All @@ -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 )
Expand Down
10 changes: 10 additions & 0 deletions src/analysis/raster/qgsrelief.cpp
Expand Up @@ -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
{
Expand All @@ -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 )
Expand Down Expand Up @@ -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 )
Expand Down
2 changes: 2 additions & 0 deletions src/analysis/vector/qgszonalstatistics.cpp
Expand Up @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions src/plugins/heatmap/heatmap.cpp
Expand Up @@ -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 );
Expand Down Expand Up @@ -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++ )
{
Expand Down Expand Up @@ -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 );
}
}
Expand Down
8 changes: 8 additions & 0 deletions src/providers/wcs/qgswcsprovider.cpp
Expand Up @@ -588,7 +588,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++ )
Expand All @@ -603,15 +605,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" ) );
}
}
Expand Down

0 comments on commit 995967a

Please sign in to comment.