Skip to content

Commit

Permalink
Improve selection of PostGIS raster overviews
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere authored and nyalldawson committed Nov 19, 2022
1 parent 02ff117 commit ac3b5ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/providers/postgres/raster/qgspostgresrasterprovider.cpp
Expand Up @@ -364,7 +364,8 @@ bool QgsPostgresRasterProvider::readBlock( int bandNo, const QgsRectangle &viewE
const double yRes = viewExtent.height() / height;

// Find overview
const int minPixelSize { static_cast<int>( std::min( xRes, yRes ) ) };
const double minPixelSize { std::min( xRes, yRes ) };

// TODO: round?
const unsigned int desiredOverviewFactor { static_cast<unsigned int>( minPixelSize / std::max( std::abs( mScaleX ), std::abs( mScaleY ) ) ) };

Expand Down

0 comments on commit ac3b5ab

Please sign in to comment.