 Hello, this is Hans van der Kwas senior lecturer at IHG Delft Institute for Water Education. I often get the question on how to add strahler orders to a vector river system. In other videos I've showed how to derive the strahler orders from a digital elevation model. But sometimes you have a vector layer with rivers and you want to add the strahler orders. In this video we'll use data from OpenStreetMap that we'll download and we select the river system and on the way you'll see some vector editing tools that we need to do and we're going to use a new plugin, the lines ranking plugin. So let's get started. Let's first install the quick OSM plugin which we can use to download the rivers from OpenStreetMap. You can use this tool to download anything that is on the OpenStreetMap as vectors. So after installing the plugin you find it in the vector menu and for the rivers we use as a key waterway and value river. And I want it within the layer extent of this catchment boundary and I want the rivers as lines. Run the query. If you have a slow connection you can increase the timeout. Okay, the rivers have downloaded. As you see it's not exactly what we need so we need to do some editing. First of all we need to select all the rivers that are within our catchment, there are different ways of doing it. You can also clip it but here I'm going to show how to select it by the name and the attribute table. So there's a name field and I can use this select by expression and then we use the name field and if I click all unique I get all the unique names there and the river that we're looking at is called the roar so I will add everything that is having roar in its name and I can add to the current selection and so build up the selection. It's a transboundary catchment so the name of the river is also in another language in Dutch it's roar with oe so we're also adding those to get a complete selection. And there are some parts that we are missing and we can look up the name with the identified tool so that's the earth we extend the selection to also include those, Olaf and the India and the worm, the bake fleece then we still need to do some manual corrections and this depends on your expert knowledge of the area and what you consider part of the river or not. Another way of doing this is to add also the streams from open street map but there are a lot of little streams here so that would be maybe much more work so be creative in what GIS techniques you use here we're just going to do it manually and add selections, inspect the river and correct the errors so if I want to add this one I keep control pushed and then select the segments that I want to add it'll be zoomed in a bit if you want to do it properly now important issues are these where we have these loops and you need to remove this so you need to choose what you see as the main branch of the river and then deselect them in the same way so keep control pushed and then the selection button and it's important to inspect the whole river for these things so let's see what's happening here there's a loop if I select deselect this part it's part of the downstream and here it's part of the upstream so here we need to split the line so we can deselect the different segments we go to editing mode click on edit I choose split features or I have split the features I save the split there with the selection button I can then see which ones I need and then we do that for also the other loops until we have a corrected dataset based on our expert knowledge what belongs to the river and what doesn't but there should not be loops I'm going to add open street map here because some parts are missing and I want to extend the river for those parts here we see our little yellow line in the river and we see that there it goes underground and I toggle to editing mode and then I can select a node and I want to connect these nodes so it's good to switch on the snapping so I add here the snapping toolbar switch on the snapping to the vertices and I select and you see that little plus that means that you can extend if you use the plus sign and then I can snap it to the other vertex and connect them click and there our line is added save the edits and we continue the checking in the same way we add other missing parts and then we export the selected features do a new file call it river selected so adjust the projection and there's our selected river system but you see that there's still a problem that different tributaries are not distinguished that relates to the way this is digitized so now we're going to first dissolve the river into one feature now the whole river is one feature and then we're going to use a tool to create the different tributaries and rank them and the tool is a new plugin the lines ranking plugin install the plugin it's wise to save the project at this point so let's zoom in a bit to the outlet and I use this icon to start the lines ranking tool and then I can click on an outlet and it will process it I could also use a point layer but I don't use that here I just click on on the outlet and it does the ranking and to see the result I'm going to use labels for the rank field that was added by the tool and here we see that every tributary got a rank and now we need to renumber those to the strahler orders so open attribute table and toggle to editing mode I'm going to add a new field that it calls strahler it only needs a length of two because we'll not go further than 99 orders much less effect so here we have our field added and here you see that the segments can be selected as a whole segment there's still some glitches that you need to correct like here so make sure that you remove that before you do this procedure but for now I'll just continue so I've selected all the strahler one orders those are from the springs another issue and I'm going to update the strahler order with this button modified attributes of all selected features and then down we find strahler and here I can type one to set all those selected features to strahler order one and check it in the attribute table change it to selected features and now we see that they're all one let's do the same for strahler order two and for strahler order three helps if we put the strahler orders already as labels so we can see how far we are save our edits and select everything and here's the result all the strahler orders now it's probably possible to adjust that plugin and the script that's behind it to also classify the strahler orders but that's maybe something for the future also note that the plugin works from version 3.16