21 mMaximumTileWidth( 2000 ), mMaximumTileHeight( 2000 )
39 removePartInfo( bandNumber );
48 mRasterPartInfos.insert( bandNumber, pInfo );
52 int& nCols,
int& nRows,
54 int& topLeftCol,
int& topLeftRow )
59 QMap<int, RasterPartInfo>::iterator partIt = mRasterPartInfos.find( bandNumber );
60 if ( partIt == mRasterPartInfos.end() )
65 RasterPartInfo& pInfo = partIt.value();
68 if ( 0 == pInfo.nCols || 0 == pInfo.nRows )
78 if ( pInfo.currentCol == pInfo.nCols && pInfo.currentRow == pInfo.nRows )
84 nCols = qMin( mMaximumTileWidth, pInfo.nCols - pInfo.currentCol );
85 nRows = qMin( mMaximumTileHeight, pInfo.nRows - pInfo.currentRow );
86 QgsDebugMsg( QString(
"nCols = %1 nRows = %2" ).arg( nCols ).arg( nRows ) );
90 double xmin = viewPortExtent.
xMinimum() + pInfo.currentCol / ( double )pInfo.nCols * viewPortExtent.
width();
91 double xmax = viewPortExtent.
xMinimum() + ( pInfo.currentCol + nCols ) / (
double )pInfo.nCols * viewPortExtent.
width();
92 double ymin = viewPortExtent.
yMaximum() - ( pInfo.currentRow + nRows ) / (
double )pInfo.nRows * viewPortExtent.
height();
93 double ymax = viewPortExtent.
yMaximum() - pInfo.currentRow / ( double )pInfo.nRows * viewPortExtent.
height();
96 *block = mInput->
block( bandNumber, blockRect, nCols, nRows );
97 topLeftCol = pInfo.currentCol;
98 topLeftRow = pInfo.currentRow;
100 pInfo.currentCol += nCols;
101 if ( pInfo.currentCol == pInfo.nCols && pInfo.currentRow + nRows == pInfo.nRows )
103 pInfo.currentRow = pInfo.nRows;
105 else if ( pInfo.currentCol == pInfo.nCols )
107 pInfo.currentCol = 0;
108 pInfo.currentRow += nRows;
116 removePartInfo( bandNumber );
119 void QgsRasterIterator::removePartInfo(
int bandNumber )
121 QMap<int, RasterPartInfo>::iterator partIt = mRasterPartInfos.find( bandNumber );
122 if ( partIt != mRasterPartInfos.end() )
124 RasterPartInfo& pInfo = partIt.value();
126 mRasterPartInfos.remove( bandNumber );