Sampling a raster layer
Data from a raster layer can be added to a points layer by querying the value of the layer in the coordinates of the points. This process is known as sampling, and this recipe explains how to perform it.
Getting ready
Open the dem.tif
raster layer and the dem_points.shp
vector layer:
How to do it…
- In the Processing Toolbox menu, find the Add grid values to points algorithm and double-click on it to open it:
- Select the DEM in the Grids field.
- Select the point layer in the Points field.
- Click on Run to run the algorithm.
A new vector ...
Get QGIS: Becoming a GIS Power User now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.