I'm trying to change the symbol used in a layer via Python. I've been able to tunnel through a vector layer to the symbol layer, but I don't know how to change the symbol it's using. I'd like to update it using a filename.

Here's what I have so far:

layer = qgis.utils.iface.activeLayer()

r = layer.rendererV2()
sym = r.symbols()[0]

symLayer = sym.symbolLayer(0)

symLayer seems like it should have what I'm looking for, but I haven't found it yet.

Is this even possible?

| improve this question | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.