Skip to content
Permalink
Browse files

Merge pull request #1652 from gioman/processing_count_points

result field in Processing 'count points in polygon' must be integer
  • Loading branch information
alexbruy committed Oct 23, 2014
2 parents aeb9d93 + 6f30ab9 commit 88e5cde31a66e4e3d823ba12284b002d237cfd47
@@ -66,12 +66,14 @@ def processAlgorithm(self, progress):
fieldName = self.getParameterValue(self.FIELD)

polyProvider = polyLayer.dataProvider()
fields = polyProvider.fields()
fields.append(QgsField(fieldName, QVariant.Int))

(idxCount, fieldList) = vector.findOrCreateField(polyLayer,
polyLayer.pendingFields(), fieldName)

writer = self.getOutputFromName(
self.OUTPUT).getVectorWriter(fieldList.toList(),
self.OUTPUT).getVectorWriter(fields.toList(),
polyProvider.geometryType(),
polyProvider.crs())

@@ -70,13 +70,15 @@ def processAlgorithm(self, progress):
classFieldName = self.getParameterValue(self.CLASSFIELD)

polyProvider = polyLayer.dataProvider()
fields = polyProvider.fields()
fields.append(QgsField(fieldName, QVariant.Int))

classFieldIndex = pointLayer.fieldNameIndex(classFieldName)
(idxCount, fieldList) = vector.findOrCreateField(polyLayer,
polyLayer.pendingFields(), fieldName)

writer = self.getOutputFromName(
self.OUTPUT).getVectorWriter(fieldList.toList(),
self.OUTPUT).getVectorWriter(fields.toList(),
polyProvider.geometryType(),
polyProvider.crs())

@@ -73,12 +73,14 @@ def processAlgorithm(self, progress):
self.getParameterValue(self.WEIGHT))

polyProvider = polyLayer.dataProvider()
fields = polyProvider.fields()
fields.append(QgsField(fieldName, QVariant.Int))

(idxCount, fieldList) = vector.findOrCreateField(polyLayer,
polyLayer.pendingFields(), fieldName)

writer = self.getOutputFromName(
self.OUTPUT).getVectorWriter(fieldList.toList(),
self.OUTPUT).getVectorWriter(fields.toList(),
polyProvider.geometryType(),
polyProvider.crs())

0 comments on commit 88e5cde

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