2

Using QGIS 3.8.2, I rasterize a Geopackage vector point layer using the Raster > Conversion > Rasterize tool, with output to a .tif file.

However, where multiple input points are within a single output cell, the tool will only output the value of one point. I need the average of all points within each cell.

Rasterizing point layer with multiple features falling inside raster cell using GDAL? describes how to sum multiple input points into one output raster cell. In this case, the solution was to incorporate the option MERGE_ALG=ADD. However, a review of the current gdal_rasterize documentation makes no mention of MERGE_ALG. Furthermore, that was done within the context of Python, which I know nothing about.

2

The gdal_rasterize option for adding values from all points within each cell is -add. There is no option to do other types of stats - such as average. You can use SAGA Rasterize algorithm from QGIS, which gives you options such as minimum/ maximum/ mean/ first last to deal with multiple values.

  • Perfect, thanks! I suppose that the MERGE_ALD option used in the previous post has been deprecated. – Stu Smith Aug 28 at 16:49
  • Sadly, the SAGA Rasterize tool does not have an "add" option... or a "count" option, which would be handy to calculate point frequency in each cell. – Stu Smith Aug 29 at 4:27

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.