Bug report #5748

QgsRasterLayer::setDrawingStyle() doesn't work

Added by Giuseppe Sucameli almost 12 years ago. Updated over 8 years ago.

Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:15254


Here's the steps to reproduce it:

1. load a single band raster layer (named rl),

2. execute the following code on the raster layer

rl.setDrawingStyle(2) # now it's SingleBandPseudoColor

the layer is not rendered at all.

If I change the drawing style from the Layer properties dialog and then if I call the snippet above again it works...


#1 Updated by Paolo Cavallini over 11 years ago

  • Target version set to Version 2.0.0

#2 Updated by Jürgen Fischer almost 10 years ago

  • Target version changed from Version 2.0.0 to Future Release - Lower Priority

#3 Updated by Médéric RIBREUX over 8 years ago

  • Status changed from Open to Feedback

Hello, bug triage...

in QGIS 2.13 master, when I set a raster from single band to pseudo-color from the layer properties, the result is a perfect empty raster. This is because there is no palette by default.
Even if the Python methods have changed with time, I think the behavior you described is normal (with no palette set, manually or passing by Python, a pseudocolor raster is always empty)...

Can we close this bug ?

#4 Updated by Giovanni Manghi over 8 years ago

  • Resolution set to invalid
  • Status changed from Feedback to Closed

closing for lack of feedback, please reopen if necessary.

Also available in: Atom PDF