[Qgis-developer] Custom raster drawing

Marco Hugentobler marco.hugentobler at karto.baug.ethz.ch
Tue Jun 12 10:55:38 EDT 2007

On Tuesday 12 June 2007 16:51:35 Barry Rowlingson wrote:
> > But can't you just use the raster transparency branch to do this? The
> > solution there is not nice from a design point of view, as it adds just a
> > new drawing mode. But it should do for the short time.
> > Load a raster, open the properties dialog, set 'Color Map' combo box
> > to 'Custom Colormap' and go to tab 'Colormap'. Then set number of entries
> > to 5, set 'Color interpolation' to 'Linearly' and press 'Classify'. Then
> > double click on the values to enter 0, 0.9, 0.95, 0.99, 1. Then double
> > click on the color boxes to set 0 to gray, 0.9 to gray, 0.95 to yellow,
> > etc. and press 'Apply'.
>   Ah ha! This looks like what I need. I haven't checked that there's
> Python bindings so I can set this up from my plugin yet though...

Right, python bindings for that functionality are missing. If you want to add 
them, the functions QgsRasterLayer::setCustomClassificationEnabled, and 
QgsRasterLayer::setValueClassification need to be exposed and also the struct 


Dr. Marco Hugentobler
Institute of Cartography
ETH Zurich
Technical Advisor QGIS Project Steering Committee
marco.hugentobler at karto.baug.ethz.ch

More information about the Qgis-developer mailing list