Tutorial: Create a groundwater level map from borehole data and a DEM

9. Sample DEM elevation at boreholes

We're now going to sample the DEM elevations at the borehole locations.

For this purpose we need to install the Point sampling tool plugin. Note that you need an internet connection to install the plugin.

1. In the main menu go to Plugins | Manage and Install Plugins...

2. In the Plugins dialogue search for the Point sampling tool and click Install Plugin.

Install Point sampling tool

3. Click the button in the toolbar to open the Point Sampling Tool dialogue.

4. In the Point Sampling Tool dialogue at the General tab choose boreholes_clipped as Layer containing sampling points. Choose all the fields from the boreholes_clipped and the DEM layer. Note that these layers need to be checked in the Layers panel in order to show up in this list. Save the Output point vector layer to an ESRI Shapefile, because this tool can't add it to an existing GeoPackage. Name it Boreholes_Z.shp.

5. Now click the Fields tab. There you can change the name of the output fields if necessary. Here we only change the DEM field to Z.

6. Click OK. Click Close to close the dialogue after processing.

7. Check the attribute table of the  Boreholes_Z layer.

You can see that the Z field has been added.

In the next section we're going to create a scatter plot of the reported elevation and the Z value from the DEM.