Skip to content
Permalink
Browse files

Fix build warnings

  • Loading branch information
nyalldawson committed Jul 25, 2016
1 parent da3ca92 commit 995967a4ac808522d108b671deead930d3269b06
@@ -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 );
}
}
@@ -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++ )
@@ -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" ) );
}
}

0 comments on commit 995967a

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