Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.