[Qgis-developer] Python - saving a layer into a geojson layer

kimaidou kimaidou at gmail.com
Thu Sep 1 04:45:06 EDT 2011


Hi list

I would like to know if there was a dedicated api method to create a new
vector layer (and save it into a file) by copying a map canvas layer (which
could be postgis, shapefile, etc.).
I have read here
http://www.qgis.org/pyqgis-cookbook/vector.html#writing-shapefiles
how to write a new shapefile. But then I would need to  "manually" copy each
feature from the chosen layer to the new one.

I was thinking of a equivalent to the right-click "Save as" which brings an
ui to choose the targer layer format, srid, etc., but I am trying to do it
programatically.

Is there a proper way to do it ?

Thanks in advance
Kimaidou
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20110901/eaa2a4a6/attachment.html


More information about the Qgis-developer mailing list