Skip to content

Commit

Permalink
fix broken Points in polygon (fix #5389)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Apr 17, 2012
1 parent 0586c77 commit be6b2a0
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions python/plugins/fTools/tools/doPointsInPolygon.py
Expand Up @@ -131,17 +131,14 @@ def compute(self, inPoly, inPts, inField, outPath, progressBar):
outFeat.setGeometry(inGeom)
pointList = []
count = 0
#(check, pointList) = pointLayer.featuresInRectangle(inGeom.boundingBox(), True, True)
#pointLayer.select(inGeom.boundingBox(), False)
#pointList = pointLayer.selectedFeatures()
pointList = spatialIndex.intersects(inGeom.boundingBox())
if len(pointList) > 0: check = 0
else: check = 1
if check == 0:
for i in pointList:
pointProvider.featureAtId( int( i ), inFeatB , True, allAttrs )
tmpGeom = QgsGeometry( inFeatB.geometry() )
if inGeom.intersects(tmpGeom.asPoint()):
if inGeom.intersects( tmpGeom ):
count = count + 1
outFeat.setAttributeMap(atMap)
outFeat.addAttribute(index, QVariant(count))
Expand Down

0 comments on commit be6b2a0

Please sign in to comment.