Skip to content
Permalink
Browse files

[processing] fix example script

  • Loading branch information
alexbruy committed Feb 10, 2016
1 parent 294f033 commit 169d35f31927de39730dd57b21ff0a0604ade5b1
@@ -2,14 +2,18 @@
##input=vector
##class_field=field input
##value_field=field input
##N unique values=output vector
##N_unique_values=output vector

from PyQt4.QtCore import QVariant
from qgis.core import QgsFeature, QgsField
from processing.tools.vector import VectorWriter

layer = processing.getObject(input)
provider = layer.dataProvider()
fields = provider.fields()
fields.append(QgsField('UNIQ_COUNT', QVariant.Int))
writer = processing.VectorWriter(output, None, fields, provider.geometryType(),
layer.crs())
writer = VectorWriter(N_unique_values, None, fields, provider.geometryType(),
layer.crs())

class_field_index = layer.fieldNameIndex(class_field)
value_field_index = layer.fieldNameIndex(value_field)

0 comments on commit 169d35f

Please sign in to comment.
You can’t perform that action at this time.