 In this video we are going to look at the output from the points-to-catchments plug-in which produces all the catchments belonging to outlets. The only problem is that we lose the attributes from the original points. In this video we are going to add those attributes back again to the polygons. In order to do that we have to look at the data carefully to make the right choices. We have here the outlets that we use to generate all these polygons. Let's just take one, this area 90, and have a closer look at the polygon and the point. Here we see that the point is in the centroid of the original pixel that was used and it's not at the boundary of the polygon. So it will be hard to join the points to the polygon. And another problem is that the geometry is having some problems because normally there should be just one feature for the catchment. And if I zoom to the layer we see that because of the factorization of the raster there are these artifacts. So we need to remove that by using dissolve. So that's the first thing that we will do. So in the Vector menu we go to Geoprocessing Tools, Dissolve. And there we're going to run it in batch because our polygons are in separate files. So we're going to choose first the files here. You can select all, make sure that you remove those outlets from the list. Then wait a little and they will all be added here in rows. And then we can check the box to load the layers on completion and we define an output name. And let's make shapefiles like the original. Call it Dissolved. And then I can use fill with numbers to add a number to the file name. So there will be unique file names. In the recording I speed it up a little bit. So it's now dissolving all these layers. Okay, it's done. And then we can check in the attribute table. Because the numbers of the files don't relate to these area numbers. We just do, in a sample, the checking. Always good to check the output. We see this one as nicely one feature as we expected. Let's check another one. Also one feature. So Dissolve, we can assume that it worked. So to make the next step easier I'm going to merge the polygons. I'm going to find it under data management tools and merge vector layers. And then I'm going to select all these dissolved ones. So I can select the ones that I don't need. And toggle the selection. And the same for the snap centroids. Click OK. And then define an output for the merged file. There will be a shapefile, let's call it merged. There we go, that's quite quick. Now it's one big file. It's no problem that the catchments overlap here. Just for the visualization might be an issue. Move it to the top so we can look at it. Put the outlet points on top. And there we see that the largest catchment is there visible. But if I check the attribute table you can also see the individual catchments. And there it is. And we also see the file name of the original file before it was merged. The next step is that we want to snap these outlets to the boundary of the polygon. And there we use snap geometries to layer from the processing toolbox. Choose the snap centroids as input layer. Use the merged one as the reference layer. And put the tolerance on 30 meters, the pixel size. Because we can only be a pixel wrong, even half a pixel, so 30 meter will be okay. And snap to the closest point. And all the other points it will leave where it is. Save it to a file. Let's check the result and here we see the original file in the purple and the green ones where it has moved. And the next step is to join the attributes by location. So as a base layer I choose the merged file. So we go copy that one and it will add the attributes of the join layer, snapped. And the rule that we're going to use is touches. So only when it touches each other, which is when the outlets are touching the boundary of the polygons. And it should because we snapped. Then it should join, create a separate feature for each matching feature. But discard the records which could not be joined. So those are the points that have not been snapped to the boundary in the previous step. And I call the output joined. I don't want to see the unjoinable features. So we can run this. And here we have the result. So the catchment polygons with the attributes of the points joined to it. So we need to check if that indeed happened. Let's select one of the sub catchments of joined. And we need to look of course at our snapped points to see if they have the same values. You can see that there are multiple points around the catchment. So we need to know which one is the outlet. So let's just try it because we don't know in this case. And open attribute table and show only the selected feature. Docket, so we have it here under the map. We'll do the same here for snapped. Also show only the selected features. And this one is ID 406. So that's not the outlet because the polygon is 391. Let's then choose the other point and see if that's the right one. And there we see 391 with the polygon 391. So that is the one. And the other one belongs to another one. Also here the polygons are overlapping. We can split them using from data management tools under the split vector layer tool. And we can use the unique ID which will be used also for the file name. And they're useful to use that object ID which is the same as the river ID I think. And then choose an output directory. You can also choose output file type here. Let's change it to the original shape files that we had and run it. Here we go. We manually have to add the result. So let's go to the browser panel. You don't see it there yet because we need to refresh the browser. Click the refresh button. And now we see those object ID and with the numbers added to the project. And let's check the result. So we started with this area 90 example. Let's open the attribute table. And there we see that it had these two features. And now we can also find the point that corresponds to that. So if I go to the original centroids then it's this point. Select it, open the attribute table. And then show selected features. And this one has ID 258. So then that would mean that if I open object ID 258 we see the same catchment. So that's okay. And then we should also see the same attributes. And there we see object ID 258 with everything added to it. So this means for in this case at least that this all went well. And you need to check, there might be some exceptions, but this was our purpose. We have joined the attributes of the point layer with the polygons.