Skip to content
Permalink
Browse files

[processing] Use null instead of nan for invalid stat values in join …

…by location summary
  • Loading branch information
nyalldawson committed Mar 31, 2019
1 parent 07fd02f commit 9eed7afb43e928b6b5e4ad5774272f077efb7a18
Showing with 3 additions and 1 deletion.
  1. +3 −1 python/plugins/processing/algs/qgis/SpatialJoinSummary.py
@@ -26,6 +26,7 @@
__revision__ = '$Format:%H$'

import os
import math

from collections import defaultdict

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

0 comments on commit 9eed7af

Please sign in to comment.
You can’t perform that action at this time.