[GIS] QGIS – point to raster – Summing attributes as value of raster

qgisrasterizationsummarizing

I'm trying to produce a raster layer. The aim is to show the summed heat consumption of every cell (100*100m).

I created an point layer with all buildings and an attribute with their heat consumption. Using the Rasterize (Polygon to Raster) funtion I can choose the attribute field heat consumption, but the output doesn't show the sum of the attribute heat consumption in every cell. The value of every cell is a random value of one building inside and not the sum of all buildings inside.The problem is I need the sum of every building inside the cell. I tested a lot of different ways to find a solution, since I'm still on beginner level, it's hard for me to find out a way to calculate this.

Best Answer

There's probably a simpler way but I would do the following:

  1. Create a 100x100m vector grid around your points layer (to match the cellsize of your raster):

    Vector > Research Tools > Vector Grid
    
  2. The grid should have an id field containing unique values. Join the grid to your point layer so that your points layer also contains the id field:

    Vector > Data Management Tools > Join attributes by location
    
  3. Each point should lie inside a grid cell and contain its ID. Now use the Field Calculator for your point layer to create a new field to calculate the sum of the heat consumption for each grid cell using the following expression:

    sum( "heat_consumption_field", group_by:="id")
    
  4. Each point with a certain id should now contain the sum of the heat consumption. Use this new field for your rasterisation.

Related Question