[Qgis-developer] Developer cookbook in SVN
Benoit EXIGE
benoit at exigesa.com
Wed Aug 11 01:17:56 EDT 2010
Hi Martin,
Many thanks for the clarification.
I'm learning how to use the QGIS API and find it quite difficult
coming from a VB6 background!! So, every bit of help is really
appreciated.
Would it be possible to over-comment the code put in the cookbook?
For example your comments below on how the colour ramp shader works
could be put above the code. Extra work on your side but very helpful
for people like me :-)
Another document that will greatly help QGIS API novices would be a
complete diagram of the objects hierarchy. You developers have it in
your heads but us common mortals strive for it ;->
Anyway, many thanks for your patience and help.
Benoit
On 11 Aug 2010, at 0:08, Martin Dobias <wonder.sk at gmail.com> wrote:
> On Mon, Aug 9, 2010 at 7:10 PM, Benoit de Cabissole <benoit at exigesa.com
> > wrote:
>> Hi all,
>>
>> The cookbook is a very good idea. Thanks to set it up!
>>
>> I've got a problem with the recipe in the raster, Single Band Rasters
>> section. The code shown to do colormap does not fully work: the
>> layer is
>> told to use a ColorRampShader, then a custom raster shader function
>> is
>> initialised and filled with relevant data (a list and flag) and then
>> nothing. How is this custom function fed back into the raster? Am I
>> missing
>> something?
>
> When you tell the layer to use color ramp shader, an appropriate
> shader function is created. So in fact it's not a custom shader
> function which is being initialized - it's the shader function which
> has been created in previous setColorShadingAlgorithm() call.
>
>
>> In my code I tried to use:
>> theLayer.setRasterShaderFunction( myShaderFunction )
>> but it only causes an "access violation" error when QGIS exits.
>
> I've fixed that issue in r14046.
>
>
>> After testing the code in the cookbook I can confirm that a
>> colormap is
>> created: the colormap tab is filled with the correct colour ramp
>> but the
>> type of colouring (symbology tab, color map combobox) is not
>> changed to
>> 'Colormap', it stays at whatever setting it was before calling the
>> code and
>> needs to be manually witched to "Colormap" to have the raster
>> taking the
>> colours of the colormap.
>>
>> Could you please complete the code in the cookbook to show the
>> final step?
>
> I've explained that in previous mail, but for the record, it has been
> added also to the cookbook (r14050).
>
> Regards
> Martin
More information about the Qgis-developer
mailing list