I'm writing a PyQGIS script for loading a set of vector layers in QGIS, and for them I have fixed SLD styles, how can I style them in the script?

1 Answer 1


Load your SLD style with

yourlayer = QgsVectorLayer('path_to_shp.shp', "Layer name", "ogr")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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