@@ -243,13 +243,13 @@ int QgsRasterStackLowestPositionAlgorithm::findPosition( std::vector< std::uniqu
243
243
double firstValue = mNoDataValue ;
244
244
bool firstValueIsNoData = true ;
245
245
246
- while ( firstValueIsNoData && ( currentPosition < inputBlocksCount ) )
246
+ while ( firstValueIsNoData && ( currentPosition < inputBlocksCount ) )
247
247
{
248
248
// check if all blocks are nodata/invalid
249
- std::unique_ptr<QgsRasterBlock> &firstBlock = inputBlocks.at (currentPosition);
250
- firstValue = firstBlock->valueAndNoData (row, col, firstValueIsNoData);
249
+ std::unique_ptr<QgsRasterBlock> &firstBlock = inputBlocks.at ( currentPosition );
250
+ firstValue = firstBlock->valueAndNoData ( row, col, firstValueIsNoData );
251
251
252
- if ( !firstBlock->isValid () || firstValueIsNoData )
252
+ if ( !firstBlock->isValid () || firstValueIsNoData )
253
253
{
254
254
noDataInRasterBlockStack = true ;
255
255
noDataCount++;
@@ -261,29 +261,29 @@ int QgsRasterStackLowestPositionAlgorithm::findPosition( std::vector< std::uniqu
261
261
currentPosition++;
262
262
}
263
263
264
- if ( noDataCount == inputBlocksCount )
264
+ if ( noDataCount == inputBlocksCount )
265
265
{
266
266
noDataInRasterBlockStack = true ;
267
267
return -1 ; // all blocks are NoData
268
268
}
269
269
else
270
270
{
271
271
// scan for the lowest value
272
- while ( currentPosition < inputBlocksCount)
272
+ while ( currentPosition < inputBlocksCount )
273
273
{
274
- std::unique_ptr< QgsRasterBlock > ¤tBlock = inputBlocks.at (currentPosition);
274
+ std::unique_ptr< QgsRasterBlock > ¤tBlock = inputBlocks.at ( currentPosition );
275
275
276
276
bool currentValueIsNoData = false ;
277
- double currentValue = currentBlock->valueAndNoData (row, col, currentValueIsNoData);
277
+ double currentValue = currentBlock->valueAndNoData ( row, col, currentValueIsNoData );
278
278
279
- if ( !currentBlock->isValid () || currentValueIsNoData)
279
+ if ( !currentBlock->isValid () || currentValueIsNoData )
280
280
{
281
281
noDataInRasterBlockStack = true ;
282
282
noDataCount++;
283
283
}
284
284
else
285
285
{
286
- if ( currentValue < firstValue)
286
+ if ( currentValue < firstValue )
287
287
{
288
288
firstValue = currentValue;
289
289
lowestPosition = currentPosition;
@@ -346,13 +346,13 @@ int QgsRasterStackHighestPositionAlgorithm::findPosition( std::vector< std::uniq
346
346
double firstValue = mNoDataValue ;
347
347
bool firstValueIsNoData = true ;
348
348
349
- while ( firstValueIsNoData && ( currentPosition < inputBlocksCount ) )
349
+ while ( firstValueIsNoData && ( currentPosition < inputBlocksCount ) )
350
350
{
351
351
// check if all blocks are nodata/invalid
352
- std::unique_ptr<QgsRasterBlock> &firstBlock = inputBlocks.at (currentPosition);
353
- firstValue = firstBlock->valueAndNoData (row, col, firstValueIsNoData);
352
+ std::unique_ptr<QgsRasterBlock> &firstBlock = inputBlocks.at ( currentPosition );
353
+ firstValue = firstBlock->valueAndNoData ( row, col, firstValueIsNoData );
354
354
355
- if ( !firstBlock->isValid () || firstValueIsNoData )
355
+ if ( !firstBlock->isValid () || firstValueIsNoData )
356
356
{
357
357
noDataInRasterBlockStack = true ;
358
358
noDataCount++;
@@ -365,29 +365,29 @@ int QgsRasterStackHighestPositionAlgorithm::findPosition( std::vector< std::uniq
365
365
currentPosition++;
366
366
}
367
367
368
- if ( noDataCount == inputBlocksCount )
368
+ if ( noDataCount == inputBlocksCount )
369
369
{
370
370
noDataInRasterBlockStack = true ;
371
371
return -1 ; // all blocks are NoData
372
372
}
373
373
else
374
374
{
375
375
// scan for the lowest value
376
- while ( currentPosition < inputBlocksCount)
376
+ while ( currentPosition < inputBlocksCount )
377
377
{
378
- std::unique_ptr< QgsRasterBlock > ¤tBlock = inputBlocks.at (currentPosition);
378
+ std::unique_ptr< QgsRasterBlock > ¤tBlock = inputBlocks.at ( currentPosition );
379
379
380
380
bool currentValueIsNoData = false ;
381
- double currentValue = currentBlock->valueAndNoData (row, col, currentValueIsNoData);
381
+ double currentValue = currentBlock->valueAndNoData ( row, col, currentValueIsNoData );
382
382
383
- if ( !currentBlock->isValid () || currentValueIsNoData)
383
+ if ( !currentBlock->isValid () || currentValueIsNoData )
384
384
{
385
385
noDataInRasterBlockStack = true ;
386
386
noDataCount++;
387
387
}
388
388
else
389
389
{
390
- if ( currentValue > firstValue)
390
+ if ( currentValue > firstValue )
391
391
{
392
392
firstValue = currentValue;
393
393
highestPosition = currentPosition;
0 commit comments