Skip to content
Permalink
Browse files
[processing] handle NULL fields in the Random Points in Polygons (fix #…
  • Loading branch information
alexbruy committed Apr 28, 2017
1 parent 9f9e711 commit 5c521db9670d44529c8d7f434b7408e53173379a
Showing with 5 additions and 2 deletions.
  1. +5 −2 python/plugins/processing/algs/qgis/RandomPointsPolygonsVariable.py
@@ -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

0 comments on commit 5c521db

Please sign in to comment.