[GIS] QGIS Sample Points From Raster

qgisqgis-processingrastersaga

I know that QGIS can add values from a raster to a set of points on top of the raster through the SAGA "Add raster values to points" tool. However, I would like to generate the points themselves based on some threshold of difference in the raster values.

For example, over a body of water there would be few points generated because the change in elevation is small, but over a rugged mountainous terrain there would be more points to match the changes in elevation. Is there such a tool that QGIS has or can use through its Processing Toolbox?

Best Answer

SAGA TRI (Terrain Ruggedness Index) may help from the Processing toolbox to get a value which you can apply a threshold to. You can convert your TRI raster to ASCII XYZ GRID format with Raster/Conversion/Translate. Load the ASCII XYZ GRID as delimited text layer, remove points with TRI value below your threshold. Finally apply the Add raster values to points algorithm to get a point layer with X, Y, Z coordinates. The difficult points are to find the best parameters for TRI and the reasonable threshold value.

You can use the Graphical Modeller from the Processing menu to build a new algorithm with an input threshold value.

Related Question