[Qgis-developer] VectorFileWriter

kimaidou michael.douchin at laposte.net
Tue Nov 27 11:42:52 EST 2007


>   You have to define a renderer, set its properties - this code should 
> define a continuous colour renderer that goes from green to red:
> 
>          r=QgsContinuousColorRenderer(layer.vectorType())
>          smin=QgsSymbol(layer.vectorType(), "0","","")
>          smax=QgsSymbol(layer.vectorType(), "100", "","")
>          smin.setPen(QPen(Qt.green, 1.0))
>          smax.setPen(QPen(Qt.red, 1.0))
>          r.setMinimumSymbol(smin)
>          r.setMaximumSymbol(smax)
>          r.setClassificationField(fieldNumber)
>    Then set the renderer on the layer:
>   layer.setRenderer(r)

Hi bary !
I tried to use this code to set the renderer pro
[note this code was chopped out of a larger system and so somethings 
might not work...]

  Barry
_______________________________________________
Qgis-developer mailing list
Qgis-developer at lists.qgis.org
http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer


perties, but with no success. Each time I try to load a vector layer with
that, Qgis crashes and quit with no prompt.
I tried to change some parameters, but I feel like a blind man trying to
catch a fly.

Could you please describes a bit more each line of this code. For example,
what is the purpose of the parameters in smin=QgsSymbol(layer.vectorType(),
"0","","") , or should I load the layer before or after setting the
renderer, etc.

Thanks for your help
Kimaidou
-- 
View this message in context: http://www.nabble.com/VectorFileWriter-tf4874186.html#a13974492
Sent from the qgis-developer mailing list archive at Nabble.com.




More information about the Qgis-developer mailing list