Skip to content

Commit

Permalink
[processing] handle NULL fields in the Random Points in Polygons (fix #…
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed Apr 28, 2017
1 parent 9f9e711 commit 5c521db
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -93,9 +93,12 @@ def processAlgorithm(self, progress):
fGeom = QgsGeometry(f.geometry())
bbox = fGeom.boundingBox()
if strategy == 0:
pointCount = int(f[fieldName])
pointCount = int(f[fieldName]) if f[fieldName] else 0
else:
pointCount = int(round(f[fieldName] * da.measure(fGeom)))
if f[fieldName]:
pointCount = int(round(f[fieldName] * da.measure(fGeom)))
else:
pointCount = 0

if strategy == 0 and pointCount == 0:
continue
Expand Down

0 comments on commit 5c521db

Please sign in to comment.