 Hello! Welcome back on my YouTube channel. In this video I'm going to demonstrate how to interpolate groundwater quality data from boreholes. We're going to use a data set from the Orange Synco River Basin GIS server, which is a geo-node spatial data infrastructure. And we're going to look at three different interpolation methods. First, the decent polygon method. Second, inverse distance wading. And third, creaking. We'll first search for the stump-read data set. When we search the catalog for stump-read, we'll end up with this result. And we're going to use here the borehole database in this stump-read-trout-boundary aquifer yield and water quality. If you click on the title, you can read the metadata. Then we can see that it has a lot of boreholes. And we can also see the metadata here. If we click on the attributes, we can see which water quality parameters are in this data set. And we see it has a nitrate in milligrams per liter. In QGIS, we can easily connect to a geo-node spatial data infrastructure. We go to the Data Source Manager. We choose geo-node and we create a new connection. Give it a name. Here I use Oracicon, the name of the system. And that paste the URL of the geo-node. And when I click Test Connection, it will say that the connection is successful. Then I can go back and click Connect to see all the layers in the spatial data infrastructure. So I'm going to filter on the search term stump-read that we used before to find that layer. And I'm interested in the WFS web service because that will give us the vector layer. So I'm going to use this Stas Boreholes WFS layer. But when I click Add, it will be added to our map canvas. So it's good to check if the points are in the correct location. So I'm adding the OpenStreetMap XYZ layer from the browser panel. And there I can see that this makes sense. So let's export all these features to a geo-package. So we have it in a local file. And I call this Stump-readData. So that's the name of our geo-package. And I change the layer name here to Boreholes. And I can change here the projection to the one of this area that we're going to use. And this is UTM Zone 34 South. So let's search for that. Select the coordinate reference system and click OK. In this interface you can also select specific fields to export. But here we export all. Click OK. And the data will be downloaded into our geo-package. Let's remove the online layer. If you hover your mouse over the layers you can find where it's located. And the projection. Let's also save our project to the geo-package. Choose here the geo-package and I give the project a name. Let's call it Stump-read. And also the projection of our project needs to be changed. Before we can interpolate the data we need to look at the attribute table to see if there are no data values. Let's move to the field with Nitrate. And there we see that no data is indicated with minus 9999.99. So we are going to only look at positive values, larger or equal to 0. So I make this selection. You see that the yellow dots are the selected boreholes. We are going to export the selected features to a new layer in our geo-package. This way we also keep a copy with all the boreholes so we can repeat this exercise for other quality parameters. You could select here the specific fields that you want to use in this layer. But here I'm selecting all the fields but then only for the selected boreholes. Click OK. And now we have our Nitrate borehole layer. I hide the other one. And now this will be the basis of the interpolation. Let's start with the Tizen interpolation. Go to the raster menu and choose analysis grid nearest neighbor. Therefore no data use minus 9999. Otherwise it will use 0 but 0 can also be values of Nitrate. Expand the advanced parameter section and choose there the Nitrate field to interpolate to use as a z-value. In the initial command line parameters you can specify the extent and pixel size of the result. This is covered in another video. Output data type we keep at float32 because that fits our continuous values. Choose as an output file name Nitrate Tizen. Note that we cannot add it directly to our Jill package. This is the result. Let's change the styling. Use single-bamp pseudo-color because it's a continuous raster. And choose a ramp that makes sense. Because the values are quite extreme we can use mean standard deviation or cumulative count. And I change it to red so the more red the more Nitrate. Let's repeat this for the inverse distance weighing interpolation. In the raster menu under analysis you can find their grid inverse distance to a power. There you can choose the Nitrate point layer. We can keep the default settings which uses an exponential function for the weights. Change the node data there to minus 9999. And we use the z field Nitrate. So this is one way that you can do the interpolation, very similar to Tizen. But if you want to have control in an easy way on the output pixel size and extent I can recommend to use the same tool from the processing toolbox which I will demonstrate here. I go to IDW interpolation from the processing toolbox and the dialogue is slightly different. I choose the Nitrate layer. I choose the Nitrate attribute to interpolate. I click the plus sign to add it to the interpolation points. I keep the distance coefficient also an exponential. For the extent I choose the extent of our Nitrate Borel data set. And I can choose here pixel size and I will use here a pixels of 5 kilometers. It's quite a large area and to make it fast in this demonstration I use 5 kilometer pixels. And then I save the result. Go ahead and I create IDW and then I run it and I can copy the styles from the Tizen to IDW in order to better compare them. There you see the difference. The third interpolation method that I'm going to demonstrate is creaking. For that purpose we need to install the smart map plugin. The smart map plugin has some dependencies so it's very important to go to the home page. Many of these plugins have a home page with installation instructions. And here you see the instructions for installing smart map and it gives you the dependencies. So you can either follow the instructions here to add the dependencies or use another video on my YouTube channel to use the OSGO for W installer to add missing packages. After successful installation you will find this icon here in the toolbar. When you click it you get into the smart map dialog. There indicate the data set that you want to use our nitrate data set and choose the nitrate field. Click import and it will show a preview of the data. Keep the defaults here and go to the grid tab. There we can indicate the pixel size of the output roster. So I'm using here again five kilometers to make it the same as our IDW interpolation result. And here in the graph you see all our points and in the color scale it indicates its values. And then I go to the interpolation tab and when I click calculate it constructs the semi vario ground and the color scale indicates how many points are taken into account at the lag distance. So I'm going to change here some of the parameters. The maximum distance I put it to 50 kilometers and I use a lag of five kilometers. You have to play with these values to get good results. And you can change the model that you want to fit and keep an eye on the r square and r messy values. And here I use a spherical model and it indicates basically that the spatial auto correlation in the data set is around 10 kilometers and beyond that there's no spatial correlation. So I'm going to use these settings to interpolate the borehole data set for nitrate. So I click interpolate and then it gives a preview of the result with the picture and it also loads the layer into the map canvas. You can close the dialogue and move the layer to the top. And in order to compare it with the other layers I'm going to copy the style. So now I can compare and you see the result is a bit different and it's up to you as an expert to decide what is the best result and that depends on the point density which interpolation technique is most appropriate and other assumptions of your data. I'm going to plot the point data on top of it with nitrate using graduated colors and I'm going to use the same ramp which is red, yellow, green. I click classify. The boundaries of the classes are different than the rosters but it gives us a bit of an impression where the high and low nitrate values are in our original borehole data set so you can use that to interpret the interpolation results. Let's invert the ramps because then high nitrate will be red which is more intuitive and then I can compare again the layers and the points. So here we have assumed that all the boreholes are from the same aquifer but in fact it's an aquifer system and the attribute table indicates the aquifers. So I'm duplicating the layer and I'm going to rename this one to aquifers and I'm going to style them with a categorized renderer so we can see from to which aquifer each borehole belongs. I use the aquifer attribute but here we don't need a color ramp but random colors and there each color represents to which aquifer the point belongs and this can also be used in the further interpretation of the result. The last thing that you can do is to create contour lines to visualize the gradients in nitrate here in the groundwater. So I'm creating a duplicate layer here because I'm going to use the contour renderer for the raster and I'm demonstrating this for the IDW result. I rename it to nitrate IDW contours make sure it's switched on and the active layer in the layer styling panel and I choose their contours and by default it uses contour interval of 100 but here we have smaller differences so I change it to 10 and here we see the result and you can also indicate an index contour interval so I could set it to 100 so the normal contour lines make them a bit gray and the index contours is then black I can still play a bit with the values so it seems to be too big but with 50 I see some index contours. Another thing that you can play with is the input downscaling which controls the generalization of the lines it makes it smoother and this gives a much nicer result but if we want to add labels we need to really calculate the contour lines so I'm going to do that here choose the original nitrate layer which is of course the same as the duplicate as the input layer choose the interval of 10 meters which is the same for the other visualization I choose z as an attribute name so that will be the attribute in the attribute table with the elevation values of the contours and I save it to a geopackage note that I cannot add this layer to an existing geopackage so I'm creating a new one here and this is then the result which is very comparable to our rendered result but now it has an attribute table and I can style it and add labels as if it's a normal vector layer so I'm going to make the line gray I used the same gray as we used in the previous rendered contours if you want to use different styling for the index contours have a look at my previous video on my youtube channel that gives a bit more details on the contours I choose the z value for the labels and I remove the rendered contours change the placement settings to curved and on the line to make it more readable I also use a text buffer which I make a bit more subtle and in this way you have your contour lines and we can create them also for the other interpolation results and compare them I hope this video was useful please subscribe to my youtube channel to receive updates and see you next time