Skip to content

Commit

Permalink
[Fix #7414] - points in polygon does not work
Browse files Browse the repository at this point in the history
  • Loading branch information
vinayan committed Apr 13, 2013
1 parent 27f65c2 commit 4e257bd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/plugins/fTools/tools/doPointsInPolygon.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def run(self):
fieldList = ftools_utils.getFieldList(self.layerPoly)
index = polyProvider.fieldNameIndex(unicode(self.fieldName))
if index == -1:
index = polyProvider.fieldCount()
index = polyProvider.fields().count()
fieldList.append( QgsField(unicode(self.fieldName), QVariant.Double, "real", 24, 15, self.tr("point count field")) )

sRs = polyProvider.crs()
Expand Down Expand Up @@ -218,7 +218,8 @@ def run(self):
interrupted = True
break

outFeat.setAttribute(index, QVariant(count))
atMap.append(QVariant(count))
outFeat.setAttributes(atMap)
writer.addFeature(outFeat)

self.emit( SIGNAL( "updateProgress()" ) )
Expand Down

0 comments on commit 4e257bd

Please sign in to comment.