4. Interpolate groundwater quality data

4.1. Data preparation

Before we can interpolate the NO3 concentrations we need to remove missing values. Missing values can be NULL values in the attribute table or a specific out of range value.

1. Let's inspect the attribute table. In the Layers panel right-click on the Boreholes layer and choose Open Attribute Table from the context menu.

  • Check the NO3_mg_l field. What is used here to indicate missing values?
We're now going to create a new layer without boreholes that miss NO3 values.

2. Click the Select features using an expression icon from the toolbar in the attribute table.

The value -9999.99 indicates a missing observation. In fact we expect only positive values for NO3 concentrations. So we'll create a layer with only values larger or equal to zero.

3. In the Expression field  of the Select by Expression dialog create the following expression:
"NO3_mg_l" >= 0

Remember that you can add field names to the expression by double clicking the field name under Fields and Values in the middle section of the dialog. Field names are always wrapped in double quotes in expressions.

4. Click Select Features. Click Close and check the result.

The selected features are highlighted in blue in the attribute table and the corresponding points in the map canvas show up in yellow.

Now we can export the selection to a new layer in our GeoPackage.

5. Close the attribute table.

6. In the Layers panel, right-click on the Boreholes layer and choose Export | Save Selected Features As... from the context menu.

7. Save the selected features to the Stampriet_Data GeoPackage with Layer name NO3.

Note that under Select fields to export and their export options you could choose to only select the relevant fields. Here we'll export all.

8. Hide the Boreholes layer so we only see the NO3 points.

Now we're ready to interpolate the points to rasters.