4

I would like to aggregate point statistics to a specific polygon layer which is a 100*100m raster.

The point dataset includes address data of buildings and their heating energy consumption. So the output should be a sort of heat density map with average heat energy consumption per hectare (for example).

So this is the attribute I want to aggregate on the 100*100m Raster:

Attribute of energy consumption

I tried algorithms like "Point statistics for polygon" or "v.vect.stats" where the first one was not able to create the output layer. You can see the settings below. I uploaded the protocol-file Here. Settings Point statistics for polygon

With "v.vect.stats" an output-layer is created but without calculations.

Settings:

Sittings v.vect.stats

Output:

enter image description here

The datatype of the field is "Real" and I deleted all fields with "NULL" but there were no improvements on the output.

Does anybody have experienced the same problems?

Any ideas what another factors could be why those algorithms don't work for me?

I use QGIS-Version 3.12.1-București - maybe this could be the problem?

Edit 28.02.2021: This is the protocol of "point statistics for polygons" after shortening the attribute names:

QGIS-Version: 3.12.1-București
QGIS-Codeversion: 121cc00ff0
Qt-Version: 5.11.2
GDAL-Version: 3.0.4
GEOS-Version: 3.8.1-CAPI-1.13.3
PROJ-Version: Rel. 6.3.1, February 10th, 2020
Verarbeite Algorithmus…
Algorithmus Point statistics for polygons startet…
Eingabeparameter:
{ 'AVG ' : False, 'DEV ' : False, 'FIELDS' : 'XX_HWB', 'FIELD_NAME' : 2, 'MAX ' : False, 'MIN ' : False, 'NUM ' : False, 'POINTS' : 'D:/00_Chris/01_Uni/00_Masterarbeit/PC/1_Basisdaten/WZ_Adr_point_komplett.shp', 'POLYGONS' : 'D:/00_Chris/01_Uni/00_Masterarbeit/PC/7_QGIS/export/shape/LAEA_Raster_zugeschnitten.shp|layername=LAEA_Raster_zugeschnitten', 'STATISTICS' : 'TEMPORARY_OUTPUT', 'SUM ' : True, 'VAR ' : False }

shapes_polygons "Point Statistics for Polygons" -POINTS "D:/00_Chris/01_Uni/00_Masterarbeit/PC/1_Basisdaten/WZ_Adr_point_komplett.shp" -POLYGONS "D:/00_Chris/01_Uni/00_Masterarbeit/PC/7_QGIS/export/shape/LAEA_Raster_zugeschnitten.shp" -FIELDS "XX_HWB" -FIELD_NAME 2 -SUM true -AVG false -VAR false -DEV false -MIN false -MAX false -NUM false -STATISTICS "C:/Users/chris/AppData/Local/Temp/processing_mNhjBc/40c67d2b430642ceb59f592ee18be2b9/STATISTICS.shp"
D:\00_Chris\01_Uni\00_Masterarbeit\PC\7_QGIS\projekte>PATH=C:\PROGRA~1\QGIS3~1.12\apps\qgis\bin;C:\PROGRA~1\QGIS3~1.12\apps\Python37;C:\PROGRA~1\QGIS3~1.12\apps\Python37\Scripts;C:\PROGRA~1\QGIS3~1.12\apps\qt5\bin;C:\PROGRA~1\QGIS3~1.12\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32\WBem;C:\PROGRA~1\QGIS3~1.12\apps\Python37\lib\site-packages\pywin32_system32;C:\PROGRA~1\QGIS3~1.12\apps\Python37\lib\site-packages\numpy\.libs;C:/PROGRA~1/QGIS3~1.12/apps\saga-ltr;C:/PROGRA~1/QGIS3~1.12/apps\saga-ltr\modules

D:\00_Chris\01_Uni\00_Masterarbeit\PC\7_QGIS\projekte>call saga_cmd shapes_polygons "Point Statistics for Polygons" -POINTS "D:/00_Chris/01_Uni/00_Masterarbeit/PC/1_Basisdaten/WZ_Adr_point_komplett.shp" -POLYGONS "D:/00_Chris/01_Uni/00_Masterarbeit/PC/7_QGIS/export/shape/LAEA_Raster_zugeschnitten.shp" -FIELDS "XX_HWB" -FIELD_NAME 2 -SUM true -AVG false -VAR false -DEV false -MIN false -MAX false -NUM false -STATISTICS "C:/Users/chris/AppData/Local/Temp/processing_mNhjBc/40c67d2b430642ceb59f592ee18be2b9/STATISTICS.shp"
Error: no attributes in selection
Error: executing tool [Point Statistics for Polygons]
____________________________

##### ## ##### ##
### ### ## ###
### # ## ## #### # ##
### ##### ## # #####
##### # ## ##### # ##
____________________________

SAGA Version: 2.3.2 (64 bit)

____________________________
library path: C:\PROGRA~1\QGIS3~1.12\apps\saga-ltr\modules\
library name: shapes_polygons
library : Polygons
tool : Point Statistics for Polygons
author : V. Olaya, O. Conrad (c) 2005, 2010
processors : 8 [8]
____________________________

Load shapes: D:/00_Chris/01_Uni/00_Masterarbeit/PC/1_Basisdaten/WZ_Adr_point_komplett.shp...


Parameters

Points: WZ_Adr_point_komplett
Attributes: <no attributes>
Polygons: LAEA_Raster_zugeschnitten
Statistics: Statistics
Sum: yes
Mean: no
Variance: no
Deviation: no
Minimum: no
Maximum: no
Count: no
Field Naming: original name

D:\00_Chris\01_Uni\00_Masterarbeit\PC\7_QGIS\projekte>exit
Ausführung nach 5.40 Sekunden abgeschlossen
Ergebnisse:
{'STATISTICS': 'C:/Users/chris/AppData/Local/Temp/processing_mNhjBc/40c67d2b430642ceb59f592ee18be2b9/STATISTICS.shp'}

Lade Ergebnis Layer
Die folgenden Layer wurden nicht erzeugt.<ul><li>C:/Users/chris/AppData/Local/Temp/processing_mNhjBc/40c67d2b430642ceb59f592ee18be2b9/STATISTICS.shp</li></ul>Im 'Protokoll-Fenster' im QGIS-Hauptfenster sind mehr Informationen zur Ausführung des Algorithmus zu finden.

This is how my layer looks like:

Input

This is how the wanted output should look like: enter image description here

11
  • Would u share your layers (if possible) ?
    – Snaileater
    Feb 21 at 11:05
  • Please try the native "Join Attributes by Location (Summary)" tool instead. Feb 21 at 13:08
  • @snaileater sorry, I can´t share those layers due to sensible data. @ bugmenot123 thank´s for the advice, unfortunately it didn´t work. The joined fields are also empty (NULL). Any other ideas?
    – Chris
    Feb 22 at 18:14
  • Looking at the linked SAGA protocol file, I see Error: no attributes in selection . Can you perhaps change the field name ("Gebäude_WBS_Alter_2020_4-Join_Table_Gesamt_HWB") to a simpler name without an umlaut and give it a try again?
    – Kazuhito
    Feb 23 at 0:03
  • Thank you for your answer. I registered myself so I´m the OP of this thread. I don´t think that this is the problem. I tried other attributes with shorter field names like "BGF". best regards Chris
    – Chris
    Feb 24 at 6:39
1

If I have well understood the question, the process if very simple since you can achieve what you are looking for with a single tool: "Join attributes by location (summary)" (see bugmenot123 recommendation in the comments part above)

  • Input layer: the polygon grid
  • Join layer: the points layer
  • Fields to summarize: the column containing the heat energy consumption values
  • Summaries to calculate: choose mean and/or others summaries (sum, min, max etc.)

Output: a new layer is created with a column "mean_value"

Hope it helps !

0

I used the extension "Add spreadsheet layer" to import join tables for my layers. BUT those imported fields had no "Lengh" and "Precission" defined (screenshot). enter image description here

I solved the problem by creating new fields and pasting the values using the field calculator.

1
  • The dB Manager lets you construct SQL queries between 2 layers that will handle this. I would convert buildings to points from their centroids first, however, so that you don't use the same building twice.
    – wingnut
    May 9 at 13:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.