[Qgis-developer] How to load a colour table on a raster, programmatically (in python)?

Benoit de Cabissole benoit at exigesa.com
Thu Aug 5 05:25:53 EDT 2010


Hi Developers,

Could you please help me out?

For a python plugin, I'm trying to find out how to give a custom colour
table to a one-band raster. I've looked at the QGIS API but I cannot find
the correct function(s) to use (something within the QgsRasterShader or
QgsRasterShaderFunction??).
Could you please point me to the function(s) that are used to match a custom
colour table (QgsColorRampShader?) to a raster?

BTW: I've developed the "1-band raster colour table" plugin and I want now
to be able to colour the selected raster directly from the plugin instead of
saving the colour palette to a file and asking the user to import it into
the raster manually.

Please note that I've no experience at all in C++! I can't even decipher it
:-(

Cheers,
Benoit



More information about the Qgis-developer mailing list