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:

Getting ready

How to do it…

  1. In the Processing Toolbox menu, find the Add grid values to points algorithm and double-click on it to open it:
    How to do it…
  2. Select the DEM in the Grids field.
  3. Select the point layer in the Points field.
  4. 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.