 Hello, this is Hans van der Klaas Senior Lecturer at IHE Delft Institute for Water Education. In this video we are going to interpolate contour lines, and we are going to calculate the catchment of polygons. We will use native QJS tools, and in addition PC Raster tools. In another video I have explained how to install the PC Raster tools. You can use different interpolators, but here we will use the thin interpolation method, and we see that in the attribute table of the contour lines there is the elevation field with the elevation values, so we need to choose that as the interpolation attribute. Click the plus sign to add it there as points, and then we need to define the extent of the area, which is the extent of the contour lines, and we need to choose pixel size. We choose here 50 meters. Save the result to a file. Let's go and thin them. I run it. Here is the result. You see some artifacts, but overall the interpolation went well. Now we can convert this new Raster to the PC Raster format, because we need to further process it with PC Raster. We choose the convert to PC Raster format tool, and as the output data type we choose a scalar, because it's a continuous DEM, and PC Raster has this strict Raster types that need to be defined. I call it DEM PC Raster. I run it, and now it's added to the map canvas, and I can remove the TIFF file. Now we can calculate the local drain direction map, which is the flow direction Raster in PC Raster format, and we use there for the LDD create tool. Later we need the LDD, the local drain direction map, for calculating the catchment. We can keep the defaults here. If you want to know all these parameters, check the documentation so you can fine-tune for other applications. Let's call it LDD Raster. I run it, and here we get the flow direction map in the PC Raster format. PC Raster doesn't store projections, therefore you see that question mark in the layers panel. If you want to use the projection, you can always set the projection, go to layer CRS, set CRS, and then use the EPSG code, in this case 32632, and now we have the projection added to the layer. Now let's add some polygons. If you have already polygons, then you can use those. Make sure you have reprojected them to the same projection as the DEM. Here I'll just create a temporary scratch layer, choose polygon, make sure that the projection is the same as the DEM. I create a new field that I call ID for whole numbers, because those ID numbers will be used for the catchments that will be produced in the end. So the catchments will have the same IDs. I create here polygon with ID 1, another one with ID 2, and here with ID 3, and then I save the temporary scratch layer. Now we need to rasterize these polygons. So I go to raster, conversion, rasterize, I choose there are the zones, and I use a field, the ID field, to use those values in the raster, and I define the output raster size in geo-referenced units. I give it the same units as the DEM, and I choose the output extent, the LDD layer, and this also determines the order of the steps that I'm showing, because now the rasterized polygons are really matched with the raster that we use for the catchments, which is the LDD. You can't directly produce a PC raster output, so I calculate a TIFF file here, and now I need to convert the TIFF file to the PC raster format. So I go again to the convert to PC raster format tool, choose the zone raster, and in this case it's a nominal data type, which means discrete classes with those ID numbers. Make sure that you choose dot map as the output format, and then give it a name. It's called zone PC raster, and now it is there as a nominal map with these zones with the ID numbers. And now we are ready to calculate the catchments of these polygons, so make sure you choose the LDD raster, and for the outlet layer you choose the zone PC raster layer, and then we can define the output file name, go to zone catchments, then I run it, and here we see that for each of the zones it calculated the catchment, and it uses the ID number of the zone. So I'm now overlaying the original polygons, and value 0 is for everything outside. Now we can convert these areas to polygons, go to raster conversion polygonize, choose the zone catchments, and save them to an output file name for its own catchment polygons, and there's the result. Note that I didn't indicate the projection. If you do that before then also the projection is stored with the polygon that is created, now we have assigned it. And this is how the layer looks like, and we need to remove value 0 from the attribute table, so we don't have that background polygon. And of course we want to see the ID numbers, so we can style it, go to the layer styling panel, and we can switch to categorized. If you don't choose anything they'll have the same color, but we choose here the DN value, the digital numbers, and there we see zones 1, 2, and 3, you can give them the colors that you like, and you can remove the all other values. Now it's also very easy to calculate the areas of these polygons. You can go to the attribute table, and then you can go to the field calculator, create a new field, give it the name area, and it's a decimal number, keep the default settings, and then I go here to geometry and add $area, which will give the area in the map units, in this case in square meters. So in this video you've learned how to interpolate contour lines to rusters using the tin interpolation, how to calculate the local drain direction map in PC ruster, and use that to calculate the catchment belonging to polygons, that we have defined, and then also calculate the areas of those polygons.