Skip to content

Commit 39a255c

Browse files
committedApr 1, 2019
[processing] Use null instead of nan for invalid stat values in join by location summary
1 parent 7bf9279 commit 39a255c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎python/plugins/processing/algs/qgis/SpatialJoinSummary.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
__revision__ = '$Format:%H$'
2727

2828
import os
29+
import math
2930

3031
from collections import defaultdict
3132

@@ -338,7 +339,8 @@ def addField(original, stat, type):
338339
stat.finalize()
339340
for s in numeric_fields:
340341
if s[0] in summaries:
341-
attrs.append(getattr(stat, s[2])())
342+
val = getattr(stat, s[2])()
343+
attrs.append(val if not math.isnan(val) else NULL)
342344
elif field_type == 'datetime':
343345
stat = QgsDateTimeStatisticalSummary()
344346
stat.calculate(attribute_values)

0 commit comments

Comments
 (0)
Please sign in to comment.