 Hello, welcome back on my YouTube channel. In this video we are going to create contour lines and polygons from point clouds. I am using here a tile from geotiles.nl, a hn4 point cloud data of an area with dunes in the Netherlands. When I load it into QGIS it automatically converts it to a cloud optimized point cloud or Copsi file. You can see that this data is very detailed. Each point is colored with RGB colors of an aerial photograph. We can also check the data in 3D with the QGIS 3D view. This is a dune area at the coast of the Netherlands for which I want to derive the contour lines. As far as I know there are currently no tools in QGIS to directly derive contours from the point clouds. But there are new point cloud processing tools in the processing toolbox. And there is one that I can use to export the point cloud to vector. So I am going to use that to export the points with their Z attribute to a geo package. Here under advanced parameters you can also use expressions or crop the extent. For this demo I am going to use a smaller area of the dunes which I select here in the map canvas. And I save this result to a geo package. Use when the algorithm is completed. And here you can see all the points and you check the attribute table and there you will see that there are many points converted to point vectors with an elevation value. You can create contour lines or polygons with the native algorithms that QGIS provides. The only problem is that those algorithms require a raster as input and not points. And when we interpolate points to a raster we lose some information and the result also depends on the interpolation algorithm. So here I am going to use another procedure for which we need a plugin. So go to the plugins manager and I am going to install the contour plugin. After installation you see this icon added to the toolbar. If I click the icon I can choose an input layer which is our point vector layer and I choose the Z attribute. To automatically analyze the data set and it will detect if it is on a regular grid or not. In our case this is LiDAR data and not on a regular grid. I can remove duplicate points by playing with the tolerance. I keep the default here. And I can choose if I want contour lines, if I want filled contours, if I want both or if I want a polygon contour layer. For the more I can change the method. I can use equal intervals, quantiles, logarithmic intervals, a fixed contour interval or user selected one. I use here a fixed contour interval of 1 meter because I am interested here in small elevation differences and I increase the number to 30 and these are the contours that it will generate. I could also set a minimum and maximum. And for the output I can define the name and position which means the amount of decimals it should generate but these are round numbers. So I keep the defaults and I click add. Now it has generated the contour lines, there is a temporary layer but I am interested in polygons so I choose here contour layers and that should generate the polygons. It will replace the layer that is already generated with the new information. As the result you see that the layer is in editing mode and it's a temporary scratch layer. We could style it by using for example just a simple outline and then we can see through. We can also change the colouring of the background point cloud layer by using an attribute by ramp and using the Z value and then we need to choose a ramp and then here we see the coloured points by elevation. Now I want to save the changes but this gives a commit error because somehow these polygons are not supported by the format and I didn't find a solution for them. If you would use lines it works, if you use polygons it wouldn't save it in the geopackage. But I found an alternative, if you use the processing tools that come with the plugin and use the generate contours tool you can save the result directly to a geopackage without going through a temporary file and that seems to work. Here I choose the Z attribute again and I set the tolerance and I choose which contour type. On the right side you can read the explanations of all these settings. So I choose here layer contour type and then we will get layer polygons. Choose here like previously the fixed contour interval and I change it to 30 because with our 1 meter setting we will get more 20 contour polygons. Here I can add the units, I use meters which will go down in the attribute table and then I save the result to a geopackage, save it in the same geopackage as our points were exported from the lighter data and I call it contours and then I run it and it gives some feedback that it discarded 17 points, it's triangulating many points and then contouring those triangles so it uses a thin and then it's finished close the dialogue to check the results so it's not a temporary layer now it's in our geopackage and we can check the attribute table and there we see our contours. Here we see how it created those polygons. In this video you've learned how to create contours from point cloud data.