Skip to content
Permalink
Browse files

Fix raster quantile classification

Fixes #37448
  • Loading branch information
elpaso committed Jun 28, 2020
1 parent 9b8e983 commit 2a53faf8c24eb6d5345f1dbc04e142a4b443bfc2
@@ -2737,7 +2737,7 @@ QgsRasterBandStats QgsGdalProvider::bandStatistics( int bandNo, int stats, const
//int bApproxOK = false; //as we asked for stats, don't get approx values
// GDAL does not have sample size parameter in API, just bApproxOK or not,
// we decide if approximation should be used according to
// total size / sample size ration
// total size / sample size ratio
int bApproxOK = false;
if ( sampleSize > 0 )
{
@@ -350,7 +350,7 @@ void QgsRasterInterface::initHistogram( QgsRasterHistogram &histogram,
// There is no best default value, to display something reasonable in histogram chart,
// binCount should be small, OTOH, to get precise data for cumulative cut, the number should be big.
// Because it is easier to define fixed lower value for the chart, we calc optimum binCount
// for higher resolution (to avoid calculating that where histogram() is used. In any any case,
// for higher resolution (to avoid calculating that where histogram() is used. In any case,
// it does not make sense to use more than width*height;

// for Int16/Int32 make sure bin count <= actual range, because there is no sense in having
@@ -169,6 +169,7 @@ void QgsSingleBandPseudoColorRendererWidget::setFromRenderer( const QgsRasterRen
else
{
mMinMaxWidget->setBands( QList< int >() << mBandComboBox->currentBand() );
mColorRampShaderWidget->setRasterBand( mBandComboBox->currentBand() );
}
}

@@ -183,7 +184,6 @@ void QgsSingleBandPseudoColorRendererWidget::bandChanged()

void QgsSingleBandPseudoColorRendererWidget::loadMinMax( int bandNo, double min, double max )
{
Q_UNUSED( bandNo )
QgsDebugMsg( QStringLiteral( "theBandNo = %1 min = %2 max = %3" ).arg( bandNo ).arg( min ).arg( max ) );

if ( std::isnan( min ) )

0 comments on commit 2a53faf

Please sign in to comment.
You can’t perform that action at this time.