Created
October 29, 2015 17:18
-
-
Save giohappy/796a06f1dedfffe38dec to your computer and use it in GitHub Desktop.
QGIS script for Processing to export WKT geometry representation
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
##Geometry=group | |
##Export WKT to file=name | |
##Input_Layer=vector | |
##Output_File=output file | |
from qgis.core import * | |
from PyQt4.QtCore import * | |
import processing | |
v_in = processing.getObject(Input_Layer) | |
with open(Output_File,"w") as f_out: | |
for f in v_in.getFeatures(): | |
out_str = "{0},{1}".format(f.id(),f.geometry().exportToWkt()) | |
f_out.write(out_str) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment