Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After selecting a specific band in raster properties, the dropdown in the style tab reverts always to "band1" #14118

Closed
qgib opened this issue Aug 4, 2011 · 19 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Rasters Related to general raster layer handling (not specific data formats)
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Aug 4, 2011

Author Name: Thaddeus - (Thaddeus -)
Original Redmine Issue: 4138
Affected QGIS version: master
Redmine category:rasters


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".


@qgib
Copy link
Contributor Author

qgib commented Aug 4, 2011

Author Name: Thaddeus - (Thaddeus -)


  • 3368 was configured as QGIS_Main_Window.png

@qgib
Copy link
Contributor Author

qgib commented Aug 4, 2011

Author Name: Thaddeus - (Thaddeus -)


  • 3369 was configured as Composer.png

@qgib
Copy link
Contributor Author

qgib commented Aug 4, 2011

Author Name: Thaddeus - (Thaddeus -)


  • 3370 was configured as PDF_Printout.png

@qgib
Copy link
Contributor Author

qgib commented Aug 5, 2011

Author Name: Goyo D (Goyo D)


Confirmed in 1.8.0-trunk (Ubuntu Natty).


  • category_id was configured as GUI

@qgib
Copy link
Contributor Author

qgib commented Aug 15, 2011

Author Name: Bill Clay (Bill Clay)


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();

@qgib
Copy link
Contributor Author

qgib commented Aug 15, 2011

Author Name: Giovanni Manghi (@gioman)


  • pull_request_patch_supplied was changed from 0 to 1
  • assigned_to_id was configured as Tim Sutton

@qgib
Copy link
Contributor Author

qgib commented Aug 15, 2011

Author Name: Bill Clay (Bill Clay)


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.

@qgib
Copy link
Contributor Author

qgib commented Oct 6, 2011

Author Name: Giovanni Manghi (@gioman)


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!"

@qgib
Copy link
Contributor Author

qgib commented Oct 6, 2011

Author Name: Giovanni Manghi (@gioman)


  • category_id was changed from GUI to Rasters

@qgib
Copy link
Contributor Author

qgib commented Oct 6, 2011

Author Name: Giovanni Manghi (@gioman)


  • subject was changed from Unable to keep raster band, always defaulting to Band 1. to After selecting a specific band in raster properties, the dropdown in the style tab reverts always to "band1"

@qgib
Copy link
Contributor Author

qgib commented Oct 6, 2011

Author Name: Giovanni Manghi (@gioman)


  • 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!"

see #14290

@qgib
Copy link
Contributor Author

qgib commented Oct 6, 2011

Author Name: Thaddeus - (Thaddeus -)


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.

Please see: Bug #13526, Feature #14124, Feature #14125, Bug #13088 (duplicate of #13508).

Bug #13526 Extremely Bloated PDF Vector Export under Win.

Feature #14124 New Feature: show Raster Band number on Layer Panel entries.

Feature #14125 New Feature: expose map scale to SQL queries (under "Layer Properties").

Bug #13088 Displacement between vector and WMS layers after printing

@qgib
Copy link
Contributor Author

qgib commented Nov 14, 2011

Author Name: Alister Hood (@AlisterH)


Is there any reason Bill's patch can't be applied?
It works fine.

@qgib
Copy link
Contributor Author

qgib commented Nov 18, 2011

Author Name: Giovanni Manghi (@gioman)


Alister Hood wrote:

Is there any reason Bill's patch can't be applied?
It works fine.

I agree, and the bug is really annoying. :)

@qgib
Copy link
Contributor Author

qgib commented Nov 21, 2011

Author Name: Thaddeus - (Thaddeus -)


What's the target version ? I just tried 1.7.2 and still forgets the raster band selection.

@qgib
Copy link
Contributor Author

qgib commented Dec 16, 2011

Author Name: Giovanni Manghi (@gioman)


  • fixed_version_id was configured as Version 1.7.4

@qgib
Copy link
Contributor Author

qgib commented Dec 30, 2011

Author Name: Giovanni Manghi (@gioman)


This is still confirmed on master and very annoying. Can someone review the patch and apply it?


  • version was configured as master
  • assigned_to_id removed Tim Sutton
  • priority_id was changed from Normal to 6
  • crashes_corrupts_data was configured as 0

@qgib
Copy link
Contributor Author

qgib commented Jan 15, 2012

Author Name: Alexander Bruy (@alexbruy)


Fixed in changeset "a6df30c99fd9520a96fa3e8bbed2d78a22e327e3".


  • done_ratio was changed from 0 to 100
  • status_id was changed from Open to Closed

@qgib
Copy link
Contributor Author

qgib commented Jan 15, 2012

Author Name: Alexander Bruy (@alexbruy)


  • resolution was changed from to fixed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Rasters Related to general raster layer handling (not specific data formats) labels May 24, 2019
@qgib qgib added this to the Version 1.7.4 milestone May 24, 2019
@qgib qgib closed this as completed May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! High Priority Rasters Related to general raster layer handling (not specific data formats)
Projects
None yet
Development

No branches or pull requests

1 participant