Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c334771

Browse files
committedMar 31, 2019
[processing] Use null instead of nan for invalid stat values in join by location summary
1 parent 52b2a58 commit c334771

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

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

0 commit comments

Comments
 (0)
Please sign in to comment.