A while back I wrote how one can sample raster values at point locations in QGIS using the Saga function ‘Add grid values to point’, which is available in the processing toolbox. Recently it was reported here that values uploaded from a floating raster layer are rounded up to an integer. I tried it myself in Saga, and it seems to work fine for me. But if you are running in problems with a function, it is good to remember that in QGIS you have have access to many libraries from multiple software tools. This means there are often more than one way to get things done.
And indeed, the processing toolbox offers another tool to sample raster values at point location; the GRASS GIS v.what.rast.points function. In this post I describe how to use this tool directly in GRASS, but you can use the tool in QGIS as well, as illustrated below.
Suppose we have the raster layer ‘aspect’ and the point layers ‘SamplePoint’.
Now, need to add a column to the attribute table. In the example below I add the column ‘Aspect’.
Now, open the function v.what.rast.points in the processing toolbox. Easiest is to start typing the function name in the search field. Fill in the required fields (raster name, name of the column to which you want to upload the raster values, and optionally the file name of the new point layer.
Now run the function, and you will have a new layer. Note that if you did not provide an name for the output layer, the function will create a temporary layer by default (this is the default behaviour for most if not all processing functions).
After running the function, you’ll have a new vector layer, with an attribute table with the column ‘Aspect’.
The main difference with the SAGA ‘add raster values to point’ function is that first you will need to add the columns in which you want to store the raster values. So, a bit more work, but if you need to do this often, you can try to use the Processing modeler to create a new function / tool by chaining together the two different steps.