Skip to content

Commit 57c7b8a

Browse files
committed
indentation update
1 parent 38fba0c commit 57c7b8a

File tree

5 files changed

+37
-37
lines changed

5 files changed

+37
-37
lines changed

python/plugins/processing/outputs/OutputFile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def __init__(self, name='', description='', ext = None):
3434
self.name = name
3535
self.description = description
3636
self.ext = ext
37-
37+
3838
def getFileFilter(self, alg):
3939
if self.ext is None:
4040
return 'All files(*.*)'

src/core/raster/qgsrasterblock.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ void QgsRasterBlock::applyScaleOffset( double scale, double offset )
712712
if ( !typeIsNumeric( mDataType ) ) return;
713713
if ( scale == 1.0 && offset == 0.0 ) return;
714714

715-
qgssize size = (qgssize) mWidth * mHeight;
715+
qgssize size = ( qgssize ) mWidth * mHeight;
716716
for ( qgssize i = 0; i < size; ++i )
717717
{
718718
if ( !isNoData( i ) ) setValue( i, value( i ) * scale + offset );

src/core/symbology-ng/qgssymbolv2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ QgsMapUnitScale QgsSymbolV2::mapUnitScale() const
8989
}
9090

9191
QgsSymbolLayerV2List::const_iterator it = mLayers.constBegin();
92-
if( it == mLayers.constEnd() )
92+
if ( it == mLayers.constEnd() )
9393
return QgsMapUnitScale();
9494

9595
QgsMapUnitScale scale = ( *it )->mapUnitScale();

src/providers/gdal/qgsgdalprovider.cpp

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,7 +1379,7 @@ QgsRasterHistogram QgsGdalProvider::histogram( int theBandNo,
13791379

13801380
// Min/max, if not specified, are set by histogramDefaults, it does not
13811381
// set however min/max shifted to avoid rounding errors
1382-
1382+
13831383
double myMinVal = myHistogram.minimum;
13841384
double myMaxVal = myHistogram.maximum;
13851385

@@ -1388,8 +1388,8 @@ QgsRasterHistogram QgsGdalProvider::histogram( int theBandNo,
13881388
double myOffset = bandOffset( theBandNo );
13891389
if ( myScale != 1.0 || myOffset != 0. )
13901390
{
1391-
myMinVal = (myHistogram.minimum - myOffset) / myScale;
1392-
myMaxVal = (myHistogram.maximum - myOffset) / myScale;
1391+
myMinVal = ( myHistogram.minimum - myOffset ) / myScale;
1392+
myMaxVal = ( myHistogram.maximum - myOffset ) / myScale;
13931393
}
13941394

13951395
double dfHalfBucket = ( myMaxVal - myMinVal ) / ( 2 * myHistogram.binCount );
@@ -2385,34 +2385,34 @@ QgsRasterBandStats QgsGdalProvider::bandStatistics( int theBandNo, int theStats,
23852385
myRasterBandStats.statsGathered = QgsRasterBandStats::Min | QgsRasterBandStats::Max
23862386
| QgsRasterBandStats::Range | QgsRasterBandStats::Mean
23872387
| QgsRasterBandStats::StdDev;
2388-
2388+
23892389
// define if the band has scale and offset to apply
23902390
double myScale = bandScale( theBandNo );
23912391
double myOffset = bandOffset( theBandNo );
23922392
if ( myScale != 1.0 || myOffset != 0.0 )
23932393
{
2394-
if ( myScale < 0.0 )
2395-
{
2396-
// update Min and Max value
2397-
myRasterBandStats.minimumValue = pdfMax * myScale + myOffset;
2398-
myRasterBandStats.maximumValue = pdfMin * myScale + myOffset;
2399-
// update the range
2400-
myRasterBandStats.range = (pdfMin - pdfMax) * myScale;
2401-
// update standard deviation
2402-
myRasterBandStats.stdDev = -1.0 * pdfStdDev * myScale;
2403-
}
2404-
else
2405-
{
2406-
// update Min and Max value
2407-
myRasterBandStats.minimumValue = pdfMin * myScale + myOffset;
2408-
myRasterBandStats.maximumValue = pdfMax * myScale + myOffset;
2409-
// update the range
2410-
myRasterBandStats.range = (pdfMax - pdfMin) * myScale;
2411-
// update standard deviation
2412-
myRasterBandStats.stdDev = pdfStdDev * myScale;
2413-
}
2414-
// update the mean
2415-
myRasterBandStats.mean = pdfMean * myScale + myOffset;
2394+
if ( myScale < 0.0 )
2395+
{
2396+
// update Min and Max value
2397+
myRasterBandStats.minimumValue = pdfMax * myScale + myOffset;
2398+
myRasterBandStats.maximumValue = pdfMin * myScale + myOffset;
2399+
// update the range
2400+
myRasterBandStats.range = ( pdfMin - pdfMax ) * myScale;
2401+
// update standard deviation
2402+
myRasterBandStats.stdDev = -1.0 * pdfStdDev * myScale;
2403+
}
2404+
else
2405+
{
2406+
// update Min and Max value
2407+
myRasterBandStats.minimumValue = pdfMin * myScale + myOffset;
2408+
myRasterBandStats.maximumValue = pdfMax * myScale + myOffset;
2409+
// update the range
2410+
myRasterBandStats.range = ( pdfMax - pdfMin ) * myScale;
2411+
// update standard deviation
2412+
myRasterBandStats.stdDev = pdfStdDev * myScale;
2413+
}
2414+
// update the mean
2415+
myRasterBandStats.mean = pdfMean * myScale + myOffset;
24162416
}
24172417

24182418
#ifdef QGISDEBUG

tests/src/core/testqgsrasterlayer.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -356,17 +356,17 @@ void TestQgsRasterLayer::checkScaleOffset()
356356
{
357357
mReport += "<h2>Check Stats with scale/offset</h2>\n";
358358

359-
QFileInfo myRasterFileInfo( mTestDataDir + "scaleoffset.tif" );
359+
QFileInfo myRasterFileInfo( mTestDataDir + "scaleoffset.tif" );
360360
QgsRasterLayer * myRasterLayer;
361361
myRasterLayer = new QgsRasterLayer( myRasterFileInfo.filePath(),
362362
myRasterFileInfo.completeBaseName() );
363-
QVERIFY ( myRasterLayer );
363+
QVERIFY( myRasterLayer );
364364
if ( ! myRasterLayer->isValid() )
365365
{
366366
qDebug() << QString( "raster layer %1 invalid" ).arg( myRasterFileInfo.filePath() ) ;
367367
mReport += QString( "raster layer %1 invalid" ).arg( myRasterFileInfo.filePath() ) ;
368368
delete myRasterLayer;
369-
QVERIFY ( false );
369+
QVERIFY( false );
370370
}
371371

372372
QFile::remove( myRasterFileInfo.filePath() + ".aux.xml" ); // remove cached stats
@@ -393,10 +393,10 @@ void TestQgsRasterLayer::checkScaleOffset()
393393
QVERIFY( fabs( myStatistics.stdDev - stdDev ) < 0.0000001 );
394394

395395
QgsRasterDataProvider* myProvider = myRasterLayer->dataProvider();
396-
QgsPoint myPoint(1535030, 5083350);
397-
QgsRectangle myRect(1535030-5, 5083350-5, 1535030+5, 5083350+5);
396+
QgsPoint myPoint( 1535030, 5083350 );
397+
QgsRectangle myRect( 1535030 - 5, 5083350 - 5, 1535030 + 5, 5083350 + 5 );
398398
QgsRasterIdentifyResult identifyResult = myProvider->identify( myPoint, QgsRaster::IdentifyFormatValue, myRect, 1, 1 );
399-
399+
400400
if ( identifyResult.isValid() )
401401
{
402402
QMap<int, QVariant> values = identifyResult.results();
@@ -408,7 +408,7 @@ void TestQgsRasterLayer::checkScaleOffset()
408408
valueString = tr( "no data" );
409409
mReport += QString( " %1 = %2 <br>\n" ).arg( myProvider->generateBandName( bandNo ) ).arg( valueString );
410410
delete myRasterLayer;
411-
QVERIFY ( false );
411+
QVERIFY( false );
412412
}
413413
else
414414
{
@@ -424,7 +424,7 @@ void TestQgsRasterLayer::checkScaleOffset()
424424
else
425425
{
426426
delete myRasterLayer;
427-
QVERIFY ( false );
427+
QVERIFY( false );
428428
}
429429

430430
mReport += "<p>Passed</p>";

0 commit comments

Comments
 (0)