On Saturday, 16 June 2018 20:39:29 -05 Nyall Dawson wrote:
> On Sat, 16 Jun 2018 at 02:36, Xavier Corredor Llano
> 
> <[email protected]> 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.do
> x
> 
> Nyall

Thanks Nyall, It was good reference for read more the new api changes in 
processing 
functions, finally I migrated the VectorWriter like as:

from qgis.core import QgsVectorFileWriter, QgsWkbTypes

writer = QgsVectorFileWriter(output, "System", fields, QgsWkbTypes.MultiPoint, 
crs, "ESRI 
Shapefile")
f = QgsFeature(...)
writer.addFeature(f)

Regards,
Xavier Corredor Ll.
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to