Bug report #4138
After selecting a specific band in raster properties, the dropdown in the style tab reverts always to "band1"
|Affected QGIS version:||master||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||Yes||Resolution:||fixed|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||14118|
QGIS 1.7.0 Wroclaw under Win.
Very tricky: cannot tell which of the many bands on a given layer is being displayed: cannot find any icon/name/info anywhere except under "Layer -> Properties -> Style, Single band properties" which shows the wrong band, always "Band 1" and sneakily modifies user chosen Band to always be "Band 1" if pressing OK/Apply, even when using other tabs like "Metadata".
display real band number for multiband rasters when single band gray
drawing style used (patch by Bill Clay, fix #4138)
#5 Updated by Bill Clay about 8 years ago
Here is a fix. I apologize, but it was easier to fix the bug than for this git virgin to figure out how to make git create a patch file (even after reading the QGIS coding document). Guess it's time for me to graduate from SVN. Sorry!
diff --git a/src/app/qgsrasterlayerproperties.cpp b/src/app/qgsrasterlayerproperties.cpp index 8e65d27..326644e 100644 --- a/src/app/qgsrasterlayerproperties.cpp +++ b/src/app/qgsrasterlayerproperties.cpp @@ -731,6 +731,7 @@ void QgsRasterLayerProperties::sync() cboRed->setCurrentIndex( cboRed->findText( mRasterLayer->redBandName() ) ); cboGreen->setCurrentIndex( cboGreen->findText( mRasterLayer->greenBandName() ) ); cboBlue->setCurrentIndex( cboBlue->findText( mRasterLayer->blueBandName() ) ); + cboGray->setCurrentIndex( cboGray->findText( mRasterLayer->grayBandName() ) ); //Display the current default contrast enhancement algorithm mDefaultContrastEnhancementAlgorithm = myQSettings.value( "/Raster/defaultContrastEnhancementAlgorithm", "NoEnhancement" ).toString();
#7 Updated by Bill Clay about 8 years ago
The above one-line patch does NOT report the selected band information in metadata as Thaddeus, the original reporter, requested. It does, however, show the (correctly-remembered) selected band in the raster layer properties dialog, style tab, gray band field for single-band gray layers.
#8 Updated by Giovanni Manghi almost 8 years ago
Hi Thaddeus, I can confirm the issue. Nevertheless I found not very handy to have many notes/feature_requests/described_issues embedded in the QGIS project you attached to this ticket. Please open proper tickets (one for each issue/feature request), describing everything in the "description" field, and attaching screenshot/sample data just to allow understand better the issue.
Tim: the issue is confirmed, while setting the raster to "single band" and selecting one the bands, in the raster properties it reverts always to "band1" (but QGIS is actually rendering a different band, the one selected before by the user). If the attached patch works I suggest to commit it ASAP. I confirmed the issue on qgis-trunk on Ubuntu.
Thaddeus, about the other issues you have described with annotations in the attached qgis project:
- I cannot replicate this "_~300KB of input data produces 3MB PDF printout --just 100dpi: many repeated useless Stream images and bloated/corrupted PS code?_": on my pc (qgis-trunk/Ubuntu Linux) your project results in a 250kb PDF at 100dpi (printed as vector) and 200kb if printed as raster.
- I cannot understand this "_Printing this as a vector PDF does not work: it prints an extremely-bloated wrong-coordinates raster PDF file?_" and also this "_New Feature: screen scale value exposed to the SQL queries on layers would be very nice._"
- The folloowing feature request make sense and I will open a proper ticket for it: "_How can I tell which of the many Bands on this layer is being displayed? Please print indication on "Metadata" and many other places!_"
#12 Updated by Thaddeus - almost 8 years ago
Hi Giovanni, sorry about the confusion: all the notes and comments on the QGIS canvas screenshot were mainly taking notes for myself, I'm pretty sure I made bug reports for most/each of those issues, but, for some reason, they do not show on my Redmine profile --may have been reported before Redmine era.
Bug #3466 Extremely Bloated PDF Vector Export under Win.
Feature #4144 New Feature: show Raster Band number on Layer Panel entries.
Feature #4145 New Feature: expose map scale to SQL queries (under "Layer Properties").
Bug #3028 Displacement between vector and WMS layers after printing