Skip to content

Commit

Permalink
format code
Browse files Browse the repository at this point in the history
  • Loading branch information
root676 authored and nyalldawson committed Aug 5, 2020
1 parent 5eb2754 commit f7bddb9
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions src/analysis/processing/qgsalgorithmrasterstackposition.cpp
Expand Up @@ -243,13 +243,13 @@ int QgsRasterStackLowestPositionAlgorithm::findPosition( std::vector< std::uniqu
double firstValue = mNoDataValue;
bool firstValueIsNoData = true;

while( firstValueIsNoData && ( currentPosition < inputBlocksCount ) )
while ( firstValueIsNoData && ( currentPosition < inputBlocksCount ) )
{
//check if all blocks are nodata/invalid
std::unique_ptr<QgsRasterBlock> &firstBlock = inputBlocks.at(currentPosition);
firstValue = firstBlock->valueAndNoData(row, col, firstValueIsNoData);
std::unique_ptr<QgsRasterBlock> &firstBlock = inputBlocks.at( currentPosition );
firstValue = firstBlock->valueAndNoData( row, col, firstValueIsNoData );

if( !firstBlock->isValid() || firstValueIsNoData )
if ( !firstBlock->isValid() || firstValueIsNoData )
{
noDataInRasterBlockStack = true;
noDataCount++;
Expand All @@ -261,29 +261,29 @@ int QgsRasterStackLowestPositionAlgorithm::findPosition( std::vector< std::uniqu
currentPosition++;
}

if( noDataCount == inputBlocksCount )
if ( noDataCount == inputBlocksCount )
{
noDataInRasterBlockStack = true;
return -1; //all blocks are NoData
}
else
{
//scan for the lowest value
while( currentPosition < inputBlocksCount)
while ( currentPosition < inputBlocksCount )
{
std::unique_ptr< QgsRasterBlock > &currentBlock = inputBlocks.at(currentPosition);
std::unique_ptr< QgsRasterBlock > &currentBlock = inputBlocks.at( currentPosition );

bool currentValueIsNoData = false;
double currentValue = currentBlock->valueAndNoData(row, col, currentValueIsNoData);
double currentValue = currentBlock->valueAndNoData( row, col, currentValueIsNoData );

if(!currentBlock->isValid() || currentValueIsNoData)
if ( !currentBlock->isValid() || currentValueIsNoData )
{
noDataInRasterBlockStack = true;
noDataCount++;
}
else
{
if(currentValue < firstValue)
if ( currentValue < firstValue )
{
firstValue = currentValue;
lowestPosition = currentPosition;
Expand Down Expand Up @@ -346,13 +346,13 @@ int QgsRasterStackHighestPositionAlgorithm::findPosition( std::vector< std::uniq
double firstValue = mNoDataValue;
bool firstValueIsNoData = true;

while( firstValueIsNoData && ( currentPosition < inputBlocksCount ) )
while ( firstValueIsNoData && ( currentPosition < inputBlocksCount ) )
{
//check if all blocks are nodata/invalid
std::unique_ptr<QgsRasterBlock> &firstBlock = inputBlocks.at(currentPosition);
firstValue = firstBlock->valueAndNoData(row, col, firstValueIsNoData);
std::unique_ptr<QgsRasterBlock> &firstBlock = inputBlocks.at( currentPosition );
firstValue = firstBlock->valueAndNoData( row, col, firstValueIsNoData );

if( !firstBlock->isValid() || firstValueIsNoData )
if ( !firstBlock->isValid() || firstValueIsNoData )
{
noDataInRasterBlockStack = true;
noDataCount++;
Expand All @@ -365,29 +365,29 @@ int QgsRasterStackHighestPositionAlgorithm::findPosition( std::vector< std::uniq
currentPosition++;
}

if( noDataCount == inputBlocksCount )
if ( noDataCount == inputBlocksCount )
{
noDataInRasterBlockStack = true;
return -1; //all blocks are NoData
}
else
{
//scan for the lowest value
while( currentPosition < inputBlocksCount)
while ( currentPosition < inputBlocksCount )
{
std::unique_ptr< QgsRasterBlock > &currentBlock = inputBlocks.at(currentPosition);
std::unique_ptr< QgsRasterBlock > &currentBlock = inputBlocks.at( currentPosition );

bool currentValueIsNoData = false;
double currentValue = currentBlock->valueAndNoData(row, col, currentValueIsNoData);
double currentValue = currentBlock->valueAndNoData( row, col, currentValueIsNoData );

if(!currentBlock->isValid() || currentValueIsNoData)
if ( !currentBlock->isValid() || currentValueIsNoData )
{
noDataInRasterBlockStack = true;
noDataCount++;
}
else
{
if(currentValue > firstValue)
if ( currentValue > firstValue )
{
firstValue = currentValue;
highestPosition = currentPosition;
Expand Down

0 comments on commit f7bddb9

Please sign in to comment.