[Qgis-user] Nothing displayed if sizeScaleField is set on the renderer

Lukas lukas.heiniger at sed.ethz.ch
Tue Dec 16 02:21:13 PST 2014


Hi all

PyQgis question. I'm trying to display magnitudes on a map using pyqgis. I
created a simple QgsVectorLayer that displays a dot at each earthquake
location. This works fine.

I'd like to vary the size of each dot according to each earthquake's
magnitude. I tried the following:

pr = eq_layer.dataProvider()
pr.addAttributes([QgsField('magnitude', QVariant.Double), ...])
...
renderer = self.eq_layer.rendererV2()
renderer.setSizeScaleField('magnitude')

However, as soon as I set the sizeScaleField, the layer stops showing
anything.

What am I missing?



--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Nothing-displayed-if-sizeScaleField-is-set-on-the-renderer-tp5178000.html
Sent from the Quantum GIS - User mailing list archive at Nabble.com.



More information about the Qgis-user mailing list