Bug report #10421

Join attributes by location error on textual fields

Added by dr - over 10 years ago. Updated over 7 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Processing/QGIS
Affected QGIS version:2.2.0 Regression?:
Operating System: Easy fix?:
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:18836

Description

If more than one features of joined layer intersects any feature of target layer and option "Take summary of intersecting features" is checked (with option "Sum" for example) and joined layer contains textual fields then QGIS throws Python error console:

An error has occured while executing Python code:

Traceback (most recent call last):
  File "/usr/share/qgis/python/plugins/fTools/tools/doSpatialJoin.py", line 99, in accept
    res = self.compute(inName, joinName, outPath, summary, sumList, keep, self.progressBar)
  File "/usr/share/qgis/python/plugins/fTools/tools/doSpatialJoin.py", line 219, in compute
    if k == "SUM": atMap.append(sum(numFields[j]))
TypeError: unsupported operand type(s) for +: 'int' and 'QPyNullVariant'

example_data.zip (1.82 KB) dr -, 2014-06-03 06:56 AM

joinByLocation.png (56.2 KB) dr -, 2014-06-03 06:56 AM

History

#1 Updated by dr - over 10 years ago

Description should be: If more than one features of joined layer intersects any feature of target layer and option "Take summary of intersecting features" is checked (with option "Sum" for example) and joined layer contains fields with NULL values then QGIS throws Python error console.

#2 Updated by Giovanni Manghi over 10 years ago

dr - wrote:

Description should be: If more than one features of joined layer intersects any feature of target layer and option "Take summary of intersecting features" is checked (with option "Sum" for example) and joined layer contains fields with NULL values then QGIS throws Python error console.

I cannot replicate on master, can you eventually attach a small sample dataset? Thanks.

#3 Updated by dr - over 10 years ago

I've attached example data and screenshot of settings.

#4 Updated by Giovanni Manghi over 10 years ago

  • Status changed from Open to Feedback

dr - wrote:

I've attached example data and screenshot of settings.

no error on master/windows. Cannot try now on Linux as the last build has a problem with python.

#5 Updated by Alexander Bruy over 10 years ago

Works in master for me

#6 Updated by dr - over 10 years ago

  • Status changed from Feedback to Closed

Works on master for me too.

#7 Updated by Giovanni Manghi over 7 years ago

The "ftools" category is being removed from the tracker, changing the category of this ticket to "Processing/QGIS" to not leave the category orphaned.

Also available in: Atom PDF