 Hello, welcome back on my YouTube channel. In today's video I'm going to show how to add extra tools that you can use with the PCRusterTools plugin. These tools are stored in a so called QJS Resource Sharing Repository. So let's first install the PCRusterTools plugin. Note that you also need to install PCRuster before installing this plugin, which is mentioned in the documentation. You can find it by going here to the home page. After installing the PCRusterTools plugin, I'm going to install the Resource Sharing plugin. So the Resource Sharing plugin can connect to repositories with scripts, models, styles, and many other things of QJS. After installing this plugin you find this little green button in the toolbar. And here you can add repositories. There are already a few repositories available by default, but we are going to add a custom repository. I call it PCRuster. And then we can add the link to the PCRuster repository. The link will also be provided in the comments of this video. And paste it here and add .git. Click OK and the repository is added. I've not installed any collections, so that's empty. If I go here to all collections I can install a collection. So there's a model collection, a script collection, and a user script collection. Don't use the script collection, because that has been replaced with the PCRusterTools plugin. Only use the model collection. In this case it adds four models. And the user script collection, which are scripts made by users. And I hope you will also add some if you develop your nice new scripts. Let's first add some data to test the scripts that I've added. And I'm going to add the flow direction map in PCRuster format created with LDD create. And the channels layer also in PCRuster format. There are other videos explaining how to derive this with the PCRuster tools. I'm now going to style the channels. And here we see our channel network. I'm going to test these tools to derive subcatchments of locations that I select here. So I'm going to create a notepad comma separated values file with coordinates of outlets for which I want to create subcatchments. So simply copy the coordinate by clicking right on a pixel in the channel. And add it to the list and give it a unique ID. These unique IDs will in the end be used as an attribute for the subcatchments. So I've got four of these now. Let's save the file, call it outlets. And then I can convert this to the PCRuster format. Go to data management and choose column file to PCRuster map. This converts the CSV file to roster. So I choose outlet.text. Choose as a mask the flow direction. So it will have the same extent and pixel size and projection. And I choose nominal as the data type. And I save this to outlets.map. Now we have our layer with outlets. Now let's go to our scripts and PCRuster user scripts. And there there is this tool calculate subcatchments from outlets. And it will be vector in the end. So it needs the flow direction. We have that. These are outlets that we've just created. Define the output projection and you can then save the result to a file. Let's just do a shapefile here, call it subcatchments, run it. And you'll see here how many points it detected and processes them. So we have four subcatchments here, assume to the layer. If I open the attribute table, you can see here the four features. On purpose I selected features that also overlap. The entire features are here in the shapefile, but the overlaps make them not completely visible. So you can use another tool after running this tool that you find under vector data management tools. It's called split vector layer. And you can split features from a vector layer based on an attribute. Here we use the catchment ID. So now it created a vector file for each of these four catchments. And now you can see that they indeed overlap. That's of course logical if you have an outlet that is downstream of another outlet then the subcatchment will overlap the one upstream. There's another tool, calculate subcatchments from stream order. You can use this if you have not defined the outlets, but you want to derive them automatically based on the junctions that are found in the layer. So it just needs the flow direction and a minimum stream order threshold. But here we put it at five and you can see that it has around 7000 subcatchments. So I just cancel this. And if you increase this number then it will only have larger subcatchments starting from strahler order 8. And here we see that it has around 56 of the subcatchments which is now processing. And then the result is a vector layer with all these subcatchments. And then in the same way you can split them to separate vector files. It also outputs the junctions and the rivers. So you see here under the PC Raster user scripts a lot of other tools that might be useful like burning the DEM or calculating the height above the drainage. As I said there are also models shared. So there's one here, subcatchments. And you can run it. It does a very similar thing. But the nice thing is you can also see how the model has been created and learn and modify. So I hope this was useful for you and you learned how to add these extra tools to QGIS. But also you can submit these kind of tools to the repository. We do in the pull request and then I will add them to the repository so many people can use your tools. If you like these videos then forget to subscribe to my YouTube channel and looking forward to see you again.