Created
January 9, 2019 16:51
-
-
Save categulario/4b61b87b50ece5f0cea15b659b8ee8fc to your computer and use it in GitHub Desktop.
QGis python script that exports all layers to CSV in the given directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
dirname = "/tmp/csv" # adjust this | |
for vLayer in iface.mapCanvas().layers(): | |
QgsVectorFileWriter.writeAsVectorFormat( | |
vLayer, | |
os.path.join(dirname, vLayer.name() + ".csv"), | |
"utf-8", | |
vLayer.crs(), | |
"CSV" | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment