[Fix #7414] - points in polygon does not work

This commit is contained in:
vinayan 2013-04-14 00:00:40 +05:30
parent 27f65c2355
commit 4e257bdf7e

View File

@ -169,7 +169,7 @@ class PointsInPolygonThread(QThread):
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()
@ -218,7 +218,8 @@ class PointsInPolygonThread(QThread):
interrupted = True
break
outFeat.setAttribute(index, QVariant(count))
atMap.append(QVariant(count))
outFeat.setAttributes(atMap)
writer.addFeature(outFeat)
self.emit( SIGNAL( "updateProgress()" ) )