Is there a way to export the style of a layer thanks to pyqgis in a sld file?
I didn't find it in the documentation. I am in a 3.x version of Qgis
Asked
Active
Viewed 297 times
0

Yohann Hazan
- 5
- 4
1 Answers
0
You can use QgsMapLayer::saveSldStyle to export layer style as SLD.
layer = iface.addVectorLayer('C:/example.shp', 'mylayer', 'ogr')
layer.saveSldStyle('C:/Styles/SLD/layer_style.sld')

CodeBard
- 256
- 2
- 4