- Drop the crude Lighty configuration - Use Rewrite in Apache configuration and improve README - Add histogram patch, marked to be backported
37 lines
1.7 KiB
Diff
37 lines
1.7 KiB
Diff
diff --git a/src/core/raster/qgsrasterlayer.cpp b/src/core/raster/qgsrasterlayer.cpp
|
|
index 32455e8..92c056c 100644
|
|
--- a/src/core/raster/qgsrasterlayer.cpp
|
|
+++ b/src/core/raster/qgsrasterlayer.cpp
|
|
@@ -2345,7 +2345,7 @@ void QgsRasterLayer::setDataProvider( QString const & provider,
|
|
myRasterBandStats.bandName = mDataProvider->generateBandName( i );
|
|
myRasterBandStats.bandNumber = i;
|
|
myRasterBandStats.statsGathered = false;
|
|
- myRasterBandStats.histogramVector = new QgsRasterBandStats::HistogramVector();
|
|
+ myRasterBandStats.histogramVector->clear();
|
|
//Store the default color table
|
|
//readColorTable( i, &myRasterBandStats.colorTable );
|
|
QList<QgsColorRampShader::ColorRampItem> ct;
|
|
diff --git a/src/providers/gdal/qgsgdalprovider.cpp b/src/providers/gdal/qgsgdalprovider.cpp
|
|
index 51fb786..57d1851 100644
|
|
--- a/src/providers/gdal/qgsgdalprovider.cpp
|
|
+++ b/src/providers/gdal/qgsgdalprovider.cpp
|
|
@@ -1320,8 +1320,16 @@ void QgsGdalProvider::populateHistogram( int theBandNo, QgsRasterBandStats & t
|
|
|
|
for ( int myBin = 0; myBin < theBinCount; myBin++ )
|
|
{
|
|
- theBandStats.histogramVector->push_back( myHistogramArray[myBin] );
|
|
- QgsDebugMsg( "Added " + QString::number( myHistogramArray[myBin] ) + " to histogram vector" );
|
|
+ if ( myHistogramArray[myBin] < 0 ) //can't have less than 0 pixels of any value
|
|
+ {
|
|
+ theBandStats.histogramVector->push_back( 0 );
|
|
+ QgsDebugMsg( "Added 0 to histogram vector as freq was negative!" );
|
|
+ }
|
|
+ else
|
|
+ {
|
|
+ theBandStats.histogramVector->push_back( myHistogramArray[myBin] );
|
|
+ QgsDebugMsg( "Added " + QString::number( myHistogramArray[myBin] ) + " to histogram vector" );
|
|
+ }
|
|
}
|
|
|
|
}
|