Skip to content

Commit

Permalink
Rename variable to make intention clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Feb 16, 2015
1 parent 318a716 commit 153dea2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/core/raster/qgsrasterprojector.cpp
Expand Up @@ -253,7 +253,7 @@ void QgsRasterProjector::calc()
double myDestRes = mDestXRes < mDestYRes ? mDestXRes : mDestYRes;
mSqrTolerance = myDestRes * myDestRes;

const QgsCoordinateTransform* ct = QgsCoordinateTransformCache::instance()->transform( mDestCRS.authid(), mSrcCRS.authid(), mDestDatumTransform, mSrcDatumTransform );
const QgsCoordinateTransform* inverseCt = QgsCoordinateTransformCache::instance()->transform( mDestCRS.authid(), mSrcCRS.authid(), mDestDatumTransform, mSrcDatumTransform );

// Initialize the matrix by corners and middle points
mCPCols = mCPRows = 3;
Expand All @@ -273,20 +273,20 @@ void QgsRasterProjector::calc()
}
for ( int i = 0; i < mCPRows; i++ )
{
calcRow( i, ct );
calcRow( i, inverseCt );
}

while ( true )
{
bool myColsOK = checkCols( ct );
bool myColsOK = checkCols( inverseCt );
if ( !myColsOK )
{
insertRows( ct );
insertRows( inverseCt );
}
bool myRowsOK = checkRows( ct );
bool myRowsOK = checkRows( inverseCt );
if ( !myRowsOK )
{
insertCols( ct );
insertCols( inverseCt );
}
if ( myColsOK && myRowsOK )
{
Expand Down Expand Up @@ -893,10 +893,10 @@ QgsRasterBlock * QgsRasterProjector::block( int bandNo, QgsRectangle const & ex
// we cannot fill output block with no data because we use memcpy for data, not setValue().
bool doNoData = !QgsRasterBlock::typeIsNumeric( inputBlock->dataType() ) && inputBlock->hasNoData() && !inputBlock->hasNoDataValue();

const QgsCoordinateTransform* ct = 0;
const QgsCoordinateTransform* inverseCt = 0;
if ( !mApproximate )
{
ct = QgsCoordinateTransformCache::instance()->transform( mDestCRS.authid(), mSrcCRS.authid(), mDestDatumTransform, mSrcDatumTransform );
inverseCt = QgsCoordinateTransformCache::instance()->transform( mDestCRS.authid(), mSrcCRS.authid(), mDestDatumTransform, mSrcDatumTransform );
}

outputBlock->setIsNoData();
Expand All @@ -906,7 +906,7 @@ QgsRasterBlock * QgsRasterProjector::block( int bandNo, QgsRectangle const & ex
{
for ( int j = 0; j < width; ++j )
{
bool inside = srcRowCol( i, j, &srcRow, &srcCol, ct );
bool inside = srcRowCol( i, j, &srcRow, &srcCol, inverseCt );
if ( !inside ) continue; // we have everything set to no data

qgssize srcIndex = ( qgssize )srcRow * mSrcCols + srcCol;
Expand Down

0 comments on commit 153dea2

Please sign in to comment.