mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
This is a major replumbing job of the calculate stats routines. Basically before we used band names to reference any band, but there is a pro
blem with this in that I have discovered that multiband imagery can have more than one band of the same name. Consequently I am reworking eve rything to reference bands by there number. THere are also numerous other bugfixes here. This commit has been tested to work with single band grayscale imagery and paletted images, but not with multiband images (there is still some work to do on this). Also the properties dialog cu rrently scans stats for each band - this inefficient, I know about this and will submit a fix for this over the next day or two. I expect the multiband support to be commintted in the next couple of days too. Lastly, this patch includes a merge of any other commits not made by myse lf over the previous few days. git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@624 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
bd7d7d47ae
commit
964e5b9bbf
@ -139,7 +139,9 @@ QgsRasterLayerProperties::QgsRasterLayerProperties(QgsMapLayer * lyr) : QgsRaste
|
||||
myIteratorInt <= myBandCountInt;
|
||||
++myIteratorInt)
|
||||
{
|
||||
|
||||
//TODO change this so that is does not do a full stats parse for every band!
|
||||
//otherwise it takes very long - possibly we can just impement a getRasterBandName() method
|
||||
//in raster
|
||||
RasterBandStats myRasterBandStats=rasterLayer->getRasterBandStats(myIteratorInt);
|
||||
//keep a list of band names for later use
|
||||
myBandNameQStringList.append(myRasterBandStats.bandName);
|
||||
@ -173,14 +175,19 @@ QgsRasterLayerProperties::QgsRasterLayerProperties(QgsMapLayer * lyr) : QgsRaste
|
||||
|
||||
else //all other layer types use band name entries only
|
||||
{
|
||||
std::cout << "Populating combos for non paletted layer" << std::endl;
|
||||
int myBandCountInt = 1;
|
||||
for ( QStringList::Iterator myIterator = myBandNameQStringList.begin();
|
||||
myIterator != myBandNameQStringList.end();
|
||||
++myIterator )
|
||||
{
|
||||
cboGray->insertItem(*myIterator);
|
||||
cboRed->insertItem(*myIterator);
|
||||
cboGreen->insertItem(*myIterator);
|
||||
cboBlue->insertItem(*myIterator);
|
||||
QString myQString=*myIterator;
|
||||
myQString = QString::number(myBandCountInt) + " - " + myQString;
|
||||
std::cout << "Inserting : " << myQString << std::endl;
|
||||
cboGray->insertItem(myQString);
|
||||
cboRed->insertItem(myQString);
|
||||
cboGreen->insertItem(myQString);
|
||||
cboBlue->insertItem(myQString);
|
||||
}
|
||||
cboRed->insertItem("Not Set");
|
||||
cboGreen->insertItem("Not Set");
|
||||
@ -605,7 +612,7 @@ void QgsRasterLayerProperties::fillStatsTable()
|
||||
++myRowInt;
|
||||
|
||||
tblStats->setText(myRowInt,0,"Band No");
|
||||
tblStats->setText(myRowInt,1,QString::number(myRasterBandStats.bandNo));
|
||||
tblStats->setText(myRowInt,1,QString::number(myRasterBandStats.bandNoInt));
|
||||
++myRowInt;
|
||||
tblStats->setText(myRowInt,0,"minValDouble");
|
||||
tblStats->setText(myRowInt,1,QString::number(myRasterBandStats.minValDouble));
|
||||
|
Loading…
x
Reference in New Issue
Block a user