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 attributes show in the csv, not the geometry column.
How can I export both attribute and spatial data into csv file?
my work use python with pyqgis write vector layer to csv file. I want csv file have geometry but it not. still need answer
– Anubiz May 26 '13 at 07:55