Tutorial: Process groundwater data in QGIS

Site: IHE DELFT OPEN COURSEWARE
Course: GIS training for Hydrogeological Applications
Book: Tutorial: Process groundwater data in QGIS
Printed by: Guest user
Date: Thursday, 2 December 2021, 11:06 PM

1. Introduction

Now we have collected data from different internet resources we can further process the data for our groundwater GIS project, which will be in the Shire aquifer in Malawi.

After this tutorial you're able to:

  • Reproject layers
  • Select features by expression
  • Export selected features
  • Create buffers
  • Dissolve features
  • Intersect layers
  • Clip layers
  • Use the Point Sampling Tool
  • Join attributes and make them permanent

2. Theory: vector geoprocessing tools

Here's a useful video with theory on vector geoprocessing tools that we'll use in this tutorial:


3. Reproject layers

We'll start where we ended with the previous tutorial.

1. Start QGIS

2. In the main menu go to Project | Open From | GeoPackage...

3. In the Load project from GeoPackage use the button to browse to the new folder with the copy of the Malawi_GIS_data.gpkg file and choose the Malawi_Groundwater project. Click OK to open.


The Geology and Hydrogeology layers are still in a Geographic Coordinate System (GCS) with latitude/longitude coordinates in degrees (EPSG: 4326). We'll first reproject these layers to match the UTM Zone 36S / WGS-84 projection (EPSG: 32736) that we're using in this project.

4. In the Layers panel click right on the Geology layer and choose Export | Save Features As...

5. In the Save Vector Layer as... dialogue choose GeoPackage as Format, use the existing Malawi_GIS_data.gpkg and type Geology UTM as Layer name. Change the CRS to the Project CRS (EPSG: 32736).

6. Click OK.

The Malawi_GIS_data Geology UTM layer has now been added to the Layers panel, but it doesn't have the styling. We can copy the styling from the original Geology layer.

7. In the Layers panel click right on the Geology layer and choose Styles | Copy Style | All Style Categories.


8. Then in the Layers panel click right on the Malawi_GIS_data Geology UTM layer and choose Styles | Paste Style | All Style Categories.

You might need to rearrange your layers in the Layers panel to see the results.

9. Repeat steps 4 to 8 for the Hydrogeology layer and name the new layer in the GeoPackage Hydrogeology UTM.


4. Define the study area

In this section we're going to define the study area, which is the Shire Valley Alluvial Aquifer.

We can find this transboundary aquifer in the aquifers layer.

In the next subsection we're going to select the Shire Valley Alluvial Aquifer from the aquifers layer. Then we're going to export the selected feature to a new layer in our GeoPackage.

4.1. Select a feature by expression

The first step is to select the Shire Valley Alluvial Aquifer from the aquifers layer.

1. Click right on the aquifers layer in the Layers panel and choose Open Attribute Table.

2. Click the Select features using an expression button .

3. In the Select by Expression dialogue expand in the middle of the window Fields and Values and double click on AQ_NAME. This will add "AQ_NAME" to the expression on the left side of the window. Then click to add = to the expression. Now on the right side click the button and search the list that appears for Shire Valley Alluvial Aquifer. Double click on Shire Valley Alluvial Aquifer to add it to the expression, which is now:

"AQ_NAME" = 'Shire Valley Alluvial Aquifer"

Select aquifer expression

This means: select from the field AQ_NAME (field names are in double quotes) the Shire Valley Alluvial Aquifer feature. Features are in single quotes.

4. Click to select the feature based on this expression.

5. Click Close to close the dialogue.

6. Close the attribute table.

In the map canvas you can now see the selected aquifer with a yellow boundary. Selections are yellow by default in QGIS.

Now we're going to export the Shire Valley Alluvial Aquifer.

4.2. Export selected feature(s)

Now we have selected the aquifer of our study area we can export the feature to a new layer in our GeoPackage.

1. Click right on the aquifers layer in the Layers panel and choose Export | Save Selected Features As...

2. In the Save Vector Layer as... dialogue choose GeoPackage as Format. Choose our existing GeoPackage Malawi_GIS_data.gpkg as File name. Give it the Layer name Shire Valley Alluvial Aquifer. Check that the CRS is EPSG: 32736.

3. Click OK.

The Malawi_GIS_data Shire Valley Alluvial Aquifer layer is now added to the project.

Shire aquifer added as layer

In the next subsection we'll create a buffer around the aquifer boundary to extend the study area a bit to account for boundary effects.

4.3. Create a buffer around the aquifer

To account for boundary effects it is advised to create a buffer around the aquifer of our study area.

1. In the main menu go to Vector | Geoprocessing Tools | Buffer...

2. In the Buffer dialogue choose the Malawi_GIS_data Shire Valley Alluvial Aquifer as Input layer. Set the Distance to 10 kilometers. Keep the other settings as default and save the layer to the Malawi_GIS_data.gpkg with the layer name Shire buffer 10km.

Buffer dialogue

3. Click Run. Click Close to close the dialogue after processing.

Now the Shire buffer 10km layer is visible in the map canvas.

Because we're only considering the aquifer that covers Malawi, we're going to clip the Shire buffer 10km layer to the country boundary in the next subsection.

4.4. Create a country boundary by dissolving features

In this subsection we're going to clip the Shire buffer 10km layer to the boundary of Malawi.

We could download a country boundary from for example the Natural Earth dataset. Here, however, we can use the Geology UTM or Hydrogeology UTM layer which cover only Malawi. The advantage of this method is that the boundaries will better match the layers.

We can create the country boundary by dissolving all features in the Geology layer (similar for the Hydrogeology layer, but here we'll explain it for the Geology layer).

1. In the main menu go to Vector | Geoprocessing Tools | Dissolve...

2. In the Dissolve dialogue choose Malawi_GIS_data Geology UTM as Input layer and save the Dissolved layer to the Malawi_GIS_data.gpkg with the name Malawi country boundary. Keep the other settings as default so we dissolve all fields in the layer.

Dissolve to Malawi country boundary

3. Click Run. Click Close after processing.

Now the Malawi country boundary layer appears in the map canvas.

Malawi country boundary

The next step is to clip the Shire buffer 10km layer to the Malawi country boundary.

4.5. Intersect the country boundary with the buffered transboundary aquifer

To obtain the study area we need to need to retain the area of the Shire buffer 10km which falls within the Malawi country boundary.

We can do that by using an intersection.

1. In the main menu go to Vector | Geoprocessing Tools | Intersection.

2. In the Intersection dialogue choose the Shire buffer 10km layer as Input layer and the Malawi country boundary as Overlay layer. Keep the other settings as default and save the Intersection output to the Malawi_GIS_data.gpkg GeoPackage with the name Shire study area.