Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Use default raster iterator tile size
- Loading branch information
|
@@ -123,15 +123,13 @@ QVariantMap QgsRasterLayerUniqueValuesReportAlgorithm::processAlgorithm( const Q |
|
|
qgssize noDataCount = 0; |
|
|
|
|
|
qgssize layerSize = static_cast< qgssize >( mLayerWidth ) * static_cast< qgssize >( mLayerHeight ); |
|
|
int maxWidth = 4000; |
|
|
int maxHeight = 4000; |
|
|
int maxWidth = QgsRasterIterator::DEFAULT_MAXIMUM_TILE_WIDTH; |
|
|
int maxHeight = QgsRasterIterator::DEFAULT_MAXIMUM_TILE_HEIGHT; |
|
|
int nbBlocksWidth = std::ceil( 1.0 * mLayerWidth / maxWidth ); |
|
|
int nbBlocksHeight = std::ceil( 1.0 * mLayerHeight / maxHeight ); |
|
|
int nbBlocks = nbBlocksWidth * nbBlocksHeight; |
|
|
|
|
|
QgsRasterIterator iter( mInterface.get() ); |
|
|
iter.setMaximumTileWidth( maxWidth ); |
|
|
iter.setMaximumTileHeight( maxHeight ); |
|
|
iter.startRasterRead( mBand, mLayerWidth, mLayerHeight, mExtent ); |
|
|
|
|
|
int iterLeft = 0; |
|
|
|
@@ -65,12 +65,7 @@ void QgsRasterAnalysisUtils::statisticsFromMiddlePointTest( QgsRasterInterface * |
|
|
} |
|
|
polyEngine->prepareGeometry(); |
|
|
|
|
|
const int maxWidth = 4000; |
|
|
const int maxHeight = 4000; |
|
|
|
|
|
QgsRasterIterator iter( rasterInterface ); |
|
|
iter.setMaximumTileWidth( maxWidth ); |
|
|
iter.setMaximumTileHeight( maxHeight ); |
|
|
iter.startRasterRead( rasterBand, nCellsX, nCellsY, rasterBBox ); |
|
|
|
|
|
std::unique_ptr< QgsRasterBlock > block; |
|
@@ -118,12 +113,7 @@ void QgsRasterAnalysisUtils::statisticsFromPreciseIntersection( QgsRasterInterfa |
|
|
} |
|
|
polyEngine->prepareGeometry(); |
|
|
|
|
|
const int maxWidth = 4000; |
|
|
const int maxHeight = 4000; |
|
|
|
|
|
QgsRasterIterator iter( rasterInterface ); |
|
|
iter.setMaximumTileWidth( maxWidth ); |
|
|
iter.setMaximumTileHeight( maxHeight ); |
|
|
iter.startRasterRead( rasterBand, nCellsX, nCellsY, rasterBBox ); |
|
|
|
|
|
std::unique_ptr< QgsRasterBlock > block; |
|
|
|
@@ -31,12 +31,10 @@ void QgsReclassifyUtils::reclassify( const QVector<QgsReclassifyUtils::RasterCla |
|
|
QgsRasterDataProvider *destinationRaster, double destNoDataValue, bool useNoDataForMissingValues, |
|
|
QgsProcessingFeedback *feedback ) |
|
|
{ |
|
|
int maxWidth = 4000; |
|
|
int maxHeight = 4000; |
|
|
int maxWidth = QgsRasterIterator::DEFAULT_MAXIMUM_TILE_WIDTH; |
|
|
int maxHeight = QgsRasterIterator::DEFAULT_MAXIMUM_TILE_HEIGHT; |
|
|
|
|
|
QgsRasterIterator iter( sourceRaster ); |
|
|
iter.setMaximumTileWidth( maxWidth ); |
|
|
iter.setMaximumTileHeight( maxHeight ); |
|
|
iter.startRasterRead( band, sourceWidthPixels, sourceHeightPixels, extent ); |
|
|
|
|
|
int nbBlocksWidth = static_cast< int >( std::ceil( 1.0 * sourceWidthPixels / maxWidth ) ); |
|
|