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 want to change the style of the polygon contained in the vector layer. Is there any API available?

(I can click the properties of the shapefile, then select the style and change the symbol properties, but I want to do this programmatically.)

I am using Python to customise QGIS.

share|improve this question
up vote 1 down vote accepted

The documentation can be found here:

I haven't tried it yet, so I cannot provide any further pointers but the code examples there look good to go.

share|improve this answer
when we try to access class 'QgsMarkerSymbolLayerV2' from the python console inside the QGIS , It showed me that 'class doesn't exist' I am using QGIS 1.7 – Vicky Nov 5 '11 at 10:26
Works for me (running 1.7.1): >>> QgsMarkerSymbolLayerV2 <class 'qgis.core.QgsMarkerSymbolLayerV2'> – underdark Nov 5 '11 at 11:29

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.