Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix warnings
  • Loading branch information
jef-n committed Mar 20, 2016
1 parent bd3fd74 commit 5769f3b
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 4 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
18 changes: 14 additions & 4 deletions src/providers/wcs/qgswcsprovider.cpp
Expand Up @@ -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 ) ) );
Expand Down Expand Up @@ -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++ )
Expand All @@ -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" ) );
}
}
Expand Down

0 comments on commit 5769f3b

Please sign in to comment.