qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.39k stars 2.98k forks source link

Join attributes by location (summary) count returns Null #40108

Open uclaros opened 3 years ago

uclaros commented 3 years ago

Describe the bug When using the Join attributes by location (summary) processing algorithm, features that could not be joined have Null values for all their aggregate summaries. This makes total sense for aggregates that depend on field values, like mean, max, range etc, but is wrong for aggregates that do not, like count, which should show the total number of joined features: 0.

QGIS and OS versions 69faea8 on Debian testing

nyalldawson commented 3 years ago

Confirmed -- count should return 0, but the rest are correct in returning null. (Contrary to common sense, sum should also return NULL. Check select sum(1) from some_table where 1=0 in postgres to confirm -- the result is null, not 0)

mroswell commented 3 days ago

4 years later, I'm still getting null on Join attributes by location (summary). How can I populate dissolved polygons with the sum of the attributes of its constituent polygons?