 Hello, this is Hans van der Klaas Senior Lecturer at IT Delft Institute for Water Education. In this video I am going to show you how to use the white box tools for analysis of LiDAR point clouds. In a previous video I have demonstrated how to install the white box tools and add them to the processing toolbox. White box tools can only work with last files, so I prepared one in a previous video that I am adding here. And when you load a last file to QGIS it starts converting it to another format, therefore you see in the status bar how far it is with processing and meanwhile it shows you the outline of the extent and it cannot read the projection, so I am adding the projection to the project and the file. Now you see it is loaded, so this is our last file and by default it uses the classification of the points that it finds in the file. This data is from AHN3, open data from the Netherlands provided by PDOC and that has this classification. And when you have the PDOC services plugin installed you can get access to open data from the Netherlands and to get a bit of context now for this point cloud let's load the actual aerial photograph with 25 centimeter resolutions through this plugin. So we are looking at the center of Rotterdam, city in the Netherlands, and this is an interesting area because we have a lot of strange shapes here. This is the Markthal, the station black, and the Kubus Votinga or the Kube buildings and that is a good way to test these algorithms and see if we can get these shapes out of point cloud. Let's have a look at the white box tools and there we find LIDAR tools and under LIDAR tools there are a lot of different tools that we can apply to point clouds and we're first going to look at the LIDAR hillshade tool and we need to read the last file, you need to point at it from the disk because it will not read it from the layers panel and we keep the azimuth and the altitude of the sun at the default and the search radius at 1 and we define an output file. It will be another point cloud that we call hillshade and which will have the hillshade values as RGB data in the point cloud in the last file. It's done, so we can now drag from the browser panel the hillshade point cloud and when we load it, it starts converting it meanwhile we can see the extent and I add the projection and you see now in the status bar that it's converting it's almost done and now we can see the hillshade for each point if we zoom in this becomes clearer and now we see nicely the shading of the objects and we can inspect these cube buildings and the pencil tower which has this roof which shows different directions so then we can clearly see the hillshade. We can adjust the point size and the points are visualized here with squares but you can also choose circles so this gives a nice result, it's not interpolated so these are individual points that make up this hillshade image and when I zoom in you can see the points now it would also be nice to see the RGB colors. With the lighter colorize tool we can sample the colors from an image like from this aerial photograph with the RGB colors. Let's save it as a geo-tiff go to project and then export the map to image I leave the default so it will take the map canvas extent I click save and I change the file format to tiff and let's call it RGB we can load it and it's geo-referenced so if I remove the original aerial photograph we still see the picture and we're going to sample the colors from that using the lighter colorize tool so I open the last file the original one and I use the RGB geo-tiff and I'll save it to a new last file that called clipped RGB. The original file does not have the RGB channel the AHM data does not collect the RGB colors. Now I'll drag the new last file to the map canvas and it processes I set the EPSG to the projection that we use here in this project and the files almost converted and here we see our nice dots almost like a painting with all these dots and if I switch off the background then you see that it has voids where we don't have enough points where the point density is low and that's where the water is but we see that it took the colors if I would have saved the aerial photograph at a higher resolution we would probably have a better image here but this gives you an idea of sampling the colors but these voids there where the water is these are all channels in the city they need to be removed in order to do that we need to have polygons that cover the area with water and for that we can use the quick osm plugin and with quick osm plugin we can download features from open street map so the key that we use here is natural and the value is water although not much here is really natural but that's where we have to look for the waterways and we use the polygons here because we want the areas so I run the query and now we get the water polygons from open street map and you see that they cover these areas that have a low point density I think it's better to dissolve it before we proceed so it will be one polygon we can keep it as a temporary layer because we also need to project this to the same projection as the point cloud so I save the features to a shapefile call it water and set the projection to the one of our project click okay for the transformation and here we have the water polygons and now I can use from the white box lighter tools a tool that is called erase polygon from lighter so I use an input which is our original last file and it finds here our water polygon file and then I can define an output last file let's call it clipped without water and in this way it will remove all the points from the point cloud that are in those polygons for water it's done let's drag it to the map canvas it's processing I set the projection and check the mask and see what the result be after processing and here we see the result with very sharp edges where the water is and that looks very nice so our original lidar file has classes but we can improve the classification by using classify buildings in lidar but then we need a building polygon file and we can also get that from open street map so I use here as a key building and I want all the buildings so I leave value open and for the layer extent I choose the boundary of the point cloud and I want the buildings as polygons I run the query and now I have all the buildings in this area and you can already see that there's some mismatch with the orange red colors for building that we have in the point cloud so what the tool will do the classify buildings in lidar to it will classify the point cloud points that fit in the polygon to building and the others to other classes to no building in fact it will be a boolean layer so this tool I can load our last file but you see that our buildings are still in the wrong projection and need to be exported first not sure if white box tools can deal with that on the fly but it's always good practice to use layers with the same projection in these tools now they are exported and let's go back to the dialogue load our clipped without water last file there is the buildings in the correct projection and save the output and let's go at buildings dot last starts the reclassification process it's done I can drag buildings last to the map canvas and it starts processing I set the projection and that's the result and if we compare it with the original classification we see that there's some differences some sharper borders here you could also filter the lidar classes with the filter lidar classes tool and then you can give the classes that you want to exclude for example you can find the numbers of those classes in the styling panel here you see how they are coded that's standard coding that is used for lidar and there are many interesting things that we can do with these tools and I just want to highlight one which is the lidar rooftop analysis tool and you see that it has quite some parameters and the nice thing about white box is that is very well documented so here on the website whiteboxgeo.com you can find the user manual they've also started just a youtube channel so subscribe if you want to learn more about these tools and here you find all these lidar tools in the menu and there's the lidar rooftop analysis and here you can find what all these parameters mean it gives you an idea about the settings and it gives you the source code and you see there are other lidar tools that are well described here and you can see how you can use these tools also in python for example so here I use the clips without water last file and I use the buildings layer I keep the settings at default you can play around with that to get different results but let's just see what it does with all the defaults the output in this case will be a shapefile with the roof segments so the algorithm tries to find all the roofs within the building footprint and the point cloud and it will save all these roof segments to a shapefile so it's done let's close the dialogue and have a look at our roof file I need to set the projection but here it is it has classified all the segments of roofs in the building footprint and here we have the church the lounge care and we see here that every roof segment here is nicely segmented the same for the library and the cube buildings although there is some noise there maybe that can be reduced by changing some of the settings but it gives quite some good results especially for the church that looks really amazing and if you open the attribute table you'll find that each segment has a maximum elevation a hill shade a slope and an aspect and that's very useful information for all kinds of purposes so we can use that now to do some styling let me also put back the rgb in the background so to have some context and I'm going to use here a graduated symbol and for value I'm going to choose here the hill shade it was one of the fields and I use a grayscale and to just classify it and here we see the result and let's zoom in on the church and here we see the different directions of the the hill shade per segment and we can also see that here for the cube buildings and the library now when we choose aspect we can have the orientation according to the compass and that's also interesting that's in compass degrees so 0 and 360 are north and the native is south and this is useful for example if we want to know the orientation of a roof segment which can be important for solar panels for example and you saw that it also has the slope of the roof so the combination of slope and orientation will give you information about the performance of solar panels you also see the results for the cube buildings and library until now we have been looking at points but it would also be interesting to interpolate it to a digital surface model as a roster so I choose here our clipped without water last file I choose an output grid resolution of 50 centimeters I keep all the defaults here and I'm going to save this then as a geotift that I call DSM let's run it and it's quite a sophisticated algorithm that is optimized to get digital surface models out of point clouds there are other algorithms here provided you can see them here on the right like lidar idw interpolation or lidar nearest neighbor gridding you can also try those things and compare different results in this video we'll just have a look at the result of the lidar digital surface model algorithm so it produced the output but it gives a warning about the projection which we will fix later and let's zoom to the extent and we see here the elevations in grayscale and what is useful here is to render it as a hill shade and QGIS can do it on the fly so in the layer styling panel we can choose here the hill shade renderer and that will just give a very nice hill shade impression and now we can see a lot of details here we also see some artifacts of that interpolation and we can smooth that a bit by changing the resampling to bilinear here you see the result also put the zoomed out to bilinear and now we get a very nice smooth hill shade a roster of our area of interest here and we see a lot of very nice details in the trees and but we also see that it has some issues with the area where there are no points like the the water that we filtered out of the layer let's add some extra shading using the terrain shading plugin it adds some tools to the processing toolbox and i'm going to use here the ambient occlusion tool you can also try the other tools it's really great stuff and here we see that our DSM indeed doesn't have a projection so it's always wise to add that first before proceeding especially a roster analysis of elevation needs a proper projection i'll keep here also the defaults and let's save it as ambient occlusion and the output will be adjunctive we see the result again and we mark about the projection so just set it again and here we see that ambient occlusion because a lot of detailed patterns here and you see the tramway track at the station you can really follow in detail in the trees and what we can do is blend this with the hillshade layer let's do add these details now to the hillshade by using multiply and there we see the result it's a very nice metallic style roster that we get and now we get really a lot of nice details on the roofs here with the church with the church tower the library and the cube buildings very nice results now let's have a look at these point clouds with the 3d view this is the rgb point cloud that we have before and if i use the 3d view i can rotate landscape and there we see it popping out and here we have our nice points with the textures from the rgb and there are the cube buildings the pencil the library the station and the market hall building and the church in the background it will do the same if we will use the the hillshade the one that we generated on the points so this is not the roster so in this video you've learned how to use the lidar tools from whitebox tools and i think that's a great addition to qgs 3.18 with the point cloud support and in combination with the last tools it will give a lot of power to qgs to deal with point cloud data from lidar