 Hello, this is Hans van der Kwas senior lecturer at IHG Delft Institute for Water Education. I have received a question on my YouTube channel about how to calculate the concentration time of a river in a catchment using the Kierpieg equation. In this video I am going to explain the steps on how to calculate it. The steps for other equations are very similar. For this demonstration we need a digital elevation model, a layer with our channels, and just for orientation the catchment boundary polygon. I've styled it using a hill shade. The first step is to select the longest stretch of the river. So we use this selection tool, when we keep shift pushed and we use the tool we can add different selections and we just follow the river. It helps to zoom in, then you can better select the part that you need. There we are. So the yellow part is the selection of the longest stretch of the river. Now we can export that to a new file. So we click write on channels, choose export, save selected features as, and then we give it an output name, let's call it river, and we click OK. And then the selection is saved to a new shape file in this case. You can copy the style of the other one, paste the style and remove the bigger channels file not to get confused. And there we have our main river for which we want to know our concentration time. Next I need the first and the last node of the river. So I go to the processing toolbox and there's a useful tool for that. If you search for vertex you can find this tool under vector geometry extract specific vertices. We choose our river layer and the vertices have a number, so 0 is the first vertex. There's some good explanation, a well-documented tool, and let's save it to first node and see what happens. And we see that now we have the first node of each segment, that's not really what we need. We want the first node of the whole river. To achieve that we need to dissolve the river. So all segments are gone and it's just one line. To go to vector, geoprocessing tools dissolve and make sure you have selected the river. We keep the defaults there and I save it to a new file and I call it river dissolved. Let's calculate again the first vertex now with the dissolved layer, index number 0. I'll give it a new name, just call it first, run it, remove the other layer and then I see that now it really selected the first node of the line. And I also want the last one. So the same tool and if you want the last one you use minus 1. So you can count also backwards, minus 2 will be the former last, etc. And I run it, now we see that I have the first and the last one, you can see them also in the map. So now we have the two points and I want to merge them into one layer, look for a function to merge and there we have the merge vector layers tool and I select the first and the last node. Let's specify the projection and save it to a file. Let's call it first last and I run it and there it is. Check the attribute table and I see there that it has a column with the distance which is very useful. We need that later. So you see the vertex position and then the distance but I also need the elevation so I'm going to sample it from the elevation model. So we have these two points first last and I have a DTM. I'll just change the column prefix to Z and then I'll choose the name of a new file and let's call it first last Z. Check the attribute table and now we really have everything that we need. We have the distance and we have the elevation difference so we can fill in the kpg equation. Now that's very hard to do as a calculation from the attribute table using the field calculator so I'm going to show you how to make a PyQG script for that. So here's the Python script and I can run it and there we see the results printed on the screen so 21 minutes. And you can see here that I define the constants and I read from the layer the Z field and then I read the maximum value minus the minimum value and then I know the elevation difference. I read the distance field for the length then I can calculate dx and then there is the slope is dz over dx and then the concentration time is the equation k times dx to the power of constant 1 times s to the power of constant 2 and then I print the results to the screen. You can find the script in my github repository, the link is in the description of this video. I hope you've enjoyed this video and you can apply similar calculations to other equations for the concentration time. If you like these videos please subscribe for my YouTube channel and if you're looking for more free materials have a look at GIS opencourseware.org.