I use Python try to write vector layer file to csv file with this code
QgsVectorFileWriter.writeAsVectorFormat(mylayer, r'c:\temp\xyz.csv', "utf-8", None, "CSV")
It can export to xyz.csv but only attribute show in csv not geometry column. How can I export both attribute and spatial data into csv file.
Thanks.