Skip to content

Commit 4e257bd

Browse files
committedApr 13, 2013
[Fix #7414] - points in polygon does not work
1 parent 27f65c2 commit 4e257bd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎python/plugins/fTools/tools/doPointsInPolygon.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def run(self):
169169
fieldList = ftools_utils.getFieldList(self.layerPoly)
170170
index = polyProvider.fieldNameIndex(unicode(self.fieldName))
171171
if index == -1:
172-
index = polyProvider.fieldCount()
172+
index = polyProvider.fields().count()
173173
fieldList.append( QgsField(unicode(self.fieldName), QVariant.Double, "real", 24, 15, self.tr("point count field")) )
174174

175175
sRs = polyProvider.crs()
@@ -218,7 +218,8 @@ def run(self):
218218
interrupted = True
219219
break
220220

221-
outFeat.setAttribute(index, QVariant(count))
221+
atMap.append(QVariant(count))
222+
outFeat.setAttributes(atMap)
222223
writer.addFeature(outFeat)
223224

224225
self.emit( SIGNAL( "updateProgress()" ) )

0 commit comments

Comments
 (0)
Please sign in to comment.