I am currently using QGIS 2.18. I have some code to export certain shapefile layers to bring into KML. When I bring them into Google Earth, the lines are much thinner than I would prefer them to be, and I go through each layer to change their thickness. If possible, I would like to export the KMLs with a certain thickness to save time. I am using symbologyExport=QgsVectorFileWriter.FeatureSymbology, and this keeps the color of the layer but the thickness is not maintained.
for layer in layers:
name=layer.name()
if "Feeder" in name:
output_layer = r"(FolderStructureLocation...)" + name + ".kml"
QgsVectorFileWriter.writeAsVectorFormat(layer, output_layer, "utf-8", layer.crs(), "KML",symbologyExport=QgsVectorFileWriter.FeatureSymbology)