 Hi, this is Hans van der Krost from IHE Delft. In this video I will show you some of the latest updates of the PCRusterTools plugin and some pro tips. So make sure you've installed the latest version. And if you don't know how to install the plugin, check the documentation and the other videos on this YouTube channel. Because it's a processing provider plugin, you also need to install PCRuster. The resample tool is now available in the PCRusterTools plugin. We'll start with demonstrating the resample tool with a little workflow that's quite common. I have here an extent of the study area and I want to use this to create a clone map in PCRuster or a mask for which every roster that I use in my analysis has the same dimensions. So I'm going to rasterize this polygon file with a fixed value cell size of 30 by 30 meters and I also use the extent of this bounding box. I'll save it to mask and run this. Now the result is the rasterized version of the bounding box with the extent and pixel size that I want to use in my map algebra analysis with PCRuster. So I'm going to convert it to the PCRuster format. You choose that it's Boolean and I save it as clone, which is also the name used for the mask in the PCRuster terminology in the documentation. The newest version it shows the PCRuster map files as databases. I think that's a bug, so it takes some time to see then the raster layer under it, but you could also drag the database to the map canvas and it will automatically open. Like in previous QGIS versions we could just drag the file to the map canvas. So here we see our DEM, which is quite large and I want to clip it to the extent of the bounding box, which is now our clone map, and also that it uses the same cell size. And that's exactly what you use the resample tool for. So here you can read what you use it for. So if you have multiple inputs it will stitch them together and resample them to the mask that you choose. If there's one input like in our case it will resample it to the mask, in our case that's the clone map, and it will then take that extent and pixel size for the output. So this is the usual way to make the rasters the same dimension. Note that with the OSGeo4W installer for PCRuster still the 4.3.1 version is used while in Konda 4.3.2 is available. By using 4.3.2 QGIS will not crash when you use other layers than PCRuster layers in the tools. It will just give a user friendly message now. This tool uses an external command from PCRuster that is opened in the background. Later I will show you how to execute those commands if you want to have more options than are now available in the interface. Very close and let's look at the difference and now we can see that it's clipped. Now let's check if the pixel size is also changed to the one of the clone. So I here open the original and there I can read that it is a scalar map that's nice that that gives it in the properties and this is the pixel size with a lot of decimals and certainly not 30 meters. And after the resample, our clipped version, it keeps its scalar of course but now our pixel size is 30 meters. It also gives the projection and the statistics. Now I check the clone and there I also see the data type Boolean and I see that it's 30 by 30 meters. We've also fixed a bug with the lookup tool and I'm going to demonstrate this by converting this rotative to PCRuster format in the Boolean data type. It has three classes, zero is no road, one is a dirt road and two is tarmac. Copy the style to the PCRuster layer and what we will use is this tool lookup table from RAT, Raster Attribute Table and therefore we need to create a Raster Attribute Table first. We can do that by installing a plugin, the Raster Attribute Table plugin which is now available in the repository, click install and after installing this plugin I can see an extra option in the context menu to add a new attribute table. Choose the GDAL format. Now I can click open Raster Attribute Table and toggle on the editing. In the table we see the colors, we see the cell values, account field and the class field. By changing the class field I can create the lookup table. After toggling on the editing I will change value 2 in 1 so no road is 0 and all the roads are value 1. I can also use that to classify so you see now the colors changing and I save the changes. Then I use the tool lookup table from RAT and I save the file. You can quickly check it by opening a terminal or looking for the file with a notepad. This is how it looks like exactly in the lookup format. So I use the lookup tool, I choose the roads nominal, I select our lookup table, I choose the output data type, in our case that's boolean, road or no road and give it an output name. After running we find our roads boolean layer and with pelleted unique values we can check that it is boolean indeed. Next I would like to show you some updates from the PC Raster repository for the QS Resource Sharing plugin. With QS Resource Sharing plugin you can share repository with scripts and models for example. You can install the plugin from the plugins manager and after installation you can find this green button. It comes with some pre-installed links to repositories but we are going to add the PC Raster one under settings, click add repository, give it a name and then you need to paste the link from the GitHub repository that is made for sharing resources and make sure you add .git to the name otherwise it will not work. Now you can find three collections in there. To install them go to all collections and there you will also find them. So there is the QGIS PC Raster model collection which adds now in this case three models and there is the PC Raster user script collection for sharing scripts from users. It has four of them. It also has a script collection but this is not used anymore, it is replaced by the PC Raster tools plugin so don't use that anymore. So I have models and scripts added to the processing toolbox and I can now play around with that. Let's add a digital elevation model and use that for this pollution model. I am going to create a polygon layer for the pollution that we are going to route using this model. Use scratch layer or pollution. You can choose a point but I will use a polygon here and use the correct projection of the project. Give it an ID that we want to use for the routing and click OK. Let's create a little polygon for the source of the pollution. Add the ID and now fill it in. You also need a local drain direction map. We don't have that yet so we need to calculate that. It's easily done. Under that hydrology tools you find there, LDD create. Use the DEM, you can keep the defaults and save it. Click run and there is the local drain direction map which is the PC Raster terminology for the flow direction map. Use the pollution, the ID, the LDD and then you can run the tool and this will give the flow of pollution from the source and how it accumulates over the flow direction. You can also get the flow path where all the pixels get the same value as the ID number. You can modify this model, here is the whole model and you see that different tools are used from GDAL and from PC Raster, you can mix them and you can use this as inspiration to develop your own graphical models in the QDS Graphical Modeler. Another example is this one for creating automatically the subcatchments. You need to provide a minimum strata order, this is a very small catchment so keep the number very low and when we style it you'll see that it creates many subcatchments here. That always looks very colorful. Now you can also have a look at how that works. So here is the complete model that uses the different PC Raster tools for deriving this result. Another thing I would like to show is some of the scripts so they're not graphical models but they are Python scripts using functionality from QGIS and PC Raster and there you can make these kind of tools like burning in the river system. So I have here a Boolean layer with rivers and I can burn that in the DEM to force the water to flow over the rivers to follow it better than without burning them into the DEM. Let's have a look at the difference by giving it a ramp, complete style and there we see before and after burning. I also made a tool to calculate the average of a map so it's a global Raster function which results in the average value for the total map. You can find it there in the statistics and it can be the same for the other layer and then I can compare the average before and after burning. I can also use the Identify tool to get the value. The same way there's a tool for calculating the median. The median value in the DEM is 222. You can also run a model there in the Portrait model which I'll now demonstrate. I want to show you some pro tips. If you open a terminal from the QDIS browser panel you can use the PC Raster commands from the command line. This is useful if you want to go beyond the functionality provided by the user interface of the PC Raster tools plugin. Some of the commands like call to map or resample have many more arguments that you can use but they are not implemented in the interface. Let's open another terminal. And here you can also use the Agila command from PC Raster to visualize maps. This is useful for example if you want the flow direction map using this visualization with arrows. You can check the documentation of Agila for a lot of other functionality for visualization. For example I can drape the LDD over the DEM in 2D. I can also visualize the DEM in 3D. This does not work with the LDD. We can use it for our roads map for example. If you use 2 maps then you can put them side to side and they are linked and you can query the values. Thank you for watching. I hope you are now up to date with the latest of the PC Raster tools plugin. There is much more to come. Check out new upcoming videos and subscribe if you want to get updates. I'm looking forward to make new videos for you.