[Qgis-developer] Raster drawing style always set to single band gray

Marco Hugentobler marco.hugentobler at sourcepole.ch
Thu May 16 00:35:12 PDT 2013


Hi Radim

>My suggestion is to remove mDrawingStyle, drawingStyle() and
>setDrawingStyle() completely and keep only
>setRendererForDrawingStyle() for simple renderer setting. OK Marco?

+1. Thanks for cleaning this up.

Marco

On 15.05.2013 17:25, Radim Blazek wrote:
> On Tue, May 14, 2013 at 11:34 AM, Alexander Bruy
> <alexander.bruy at gmail.com> wrote:
>> Hi all,
>>
>> seems something broken in raster subsystem. Method drawingStyle() of
>> QgsRasterLayer class always returns 1 despite which rendering style
>> is set via properties or qml file.
>>
>> Steps to reproduce:
>>   1. load singleband gray raster
>>   2. open layer properties and in Style tab set "Render type" to
>>      Singleband pseudocolor
>>   3. add several classes and assign colors for them, apply changes
>>   4. close layer properties
>>   5. open Python console and run next code (raster layer should be
>>      active):
>>
>>      l = iface.mapCanvas().currentLayer()
>>      l.drawingStyle()
>>
>> This always returns value 1, but for Singleband pseudocolor it
>> must be 2.
> Drawing style was left in raster layer from 1.8 where rendering was
> done by raster layer and each DrawingStyle had rendering method in
> raster layer. In master, rendering is done by renderers set by
> setRenderer() and you can set even your custom renderer. There is no 1
> to 1 mapping between renderer and drawing style.
>
> My suggestion is to remove mDrawingStyle, drawingStyle() and
> setDrawingStyle() completely and keep only
> setRendererForDrawingStyle() for simple renderer setting. OK Marco?
>
> How / why do you need to use drawing style getter? Can you use the
> renderer directly?
>
> Radim
>
>> Should I file ticket?
>>
>> --
>> Alexander Bruy
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer


-- 
Dr. Marco Hugentobler
Sourcepole -  Linux & Open Source Solutions
Weberstrasse 5, CH-8004 Zürich, Switzerland
marco.hugentobler at sourcepole.ch http://www.sourcepole.ch
Technical Advisor QGIS Project Steering Committee



More information about the Qgis-developer mailing list