[QGIS-Developer] How to migrate the VectorWriter to Qgis3

Nyall Dawson nyall.dawson at gmail.com
Sat Jun 16 18:39:29 PDT 2018


On Sat, 16 Jun 2018 at 02:36, Xavier Corredor Llano
<xavier.corredor.llano at gmail.com> wrote:
>
> Hi Devs!
>
>
>
> I have searched and I don't found any documentation about how to migrate some functions inside processing tool, I use it inside my plugin (but it's not a processing plugin inself) and I need to migrate specifically the VectorWriter function for write a vector points file, such as:
>
>
>
> from processing.tools import vector
>
>
>
> writer = vector.VectorWriter(....)
>
> ...
>
> f = QgsFeature(...)
>
> ...
>
> writer.addFeature(f)
>

You should use the standard QgsVectorFileWriter class instead.

There's a bit of a guide to porting processing applications here:
https://raw.githubusercontent.com/qgis/QGIS/master/doc/porting_processing.dox

Nyall


More information about the QGIS-Developer mailing list