Tutorials and Supporting Documents
Point Cloud to Contours/DEM/DSM/DTM #
Contour lines, the Digital Elevation Model (DEM), and the Digital Surface Model (DSM) are commonly used geospatial deliverables derived from point clouds. This guide will show how to retrieve these models from a point cloud from RESEPI in TerraScan, and TerraModeler by Terrasolid. In this case, the Microstation platform from Bentley Systems Inc. was used, but this tutorial will be useful when using the Spatix platform as well. We will also look at how to generate reports and highlight the key aspects to consider.
Import Point Cloud #
Any work with point clouds begins with importing data. To import the data, click on “File” -> “Read points…” in the menu, as shown in Figure 1.
This will open a window for selecting the path to the point cloud location. Select the desired point cloud and click “Open”. After that, the window shown in Figure 2 will open. As you can see, the program automatically detects the projection (default UTM for RESEPI data) and the zone number. Here it is important to choose the correct type of point cloud, as this is recommended to optimize the processing speed for many automatic procedures. In this case, we will process aerial data that were recorded by a mobile lidar, so we select “Airborne Lidar” in the drop-down list. Let’s leave the other parameters unchanged and click on “OK”.
The import process will start, and it may take some time. During the process, the window shown in Figure 3 will be displayed, demonstrating that the point cloud is being loaded for further work.
Once the loading process is complete, the main program window will look as shown in Figure 4. As you can see, the Terrascan window automatically displays a list of points where you can find out the coordinates of the point and the class it belongs to. By default, all points are unclassified and belong to the general class “Class 0”.
Preprocessing point cloud #
For further work, we will need to familiarize ourselves with the classification procedure, but first, let’s cut off the unnecessary areas in our point cloud. To do this we need to:
- Click in the menu “View” -> “Display mode” and change the color of the unclassified cloud to something other than white, Figure 5.
- This will open the “Display mode” window where we click on “Colors” 1, Figure 6.
- This will open the ‘Point Classes’ window, where you can select the class whose color you want to change 2 and click “Edit” 3.
- The window “Point class” opens in which you click on the color next to the field “Color” 4 and change it, for example, to gray. After changing the color, click on “OK” in the “Point Class” window. This will close it.
- Click on “Apply” in the “Display mode” window and the point cloud will be colored as shown in Figure 7.
- The windows can then be closed by clicking on the cross in the upper left corner, Figure 7.
Now we can remove unnecessary points using the “Fence Tools”, which is located in the toolbar, Figure 8.
- Click on “Fence Tools” in the toolbar and select “Place Fence”.
- A window will appear on the right with options for selecting the area. For convenience, select the same options as shown in Figure 8. This allows us to select arbitrary polygonal areas for deletion instead of just rectangular ones (the default setting).
- Select the desired area and click on “Point” -> “Delete” -> “Outside fence” as shown in Figure 9.
- The “Delete points outside fence” window will open, Figure 10. Then click anywhere on the point cloud to accept the changes. As a result, the points that are located “outside” the selection area will be deleted, Figure 11.
As you may have noticed, the lines that are displayed for the selection area are white. Since the point cloud is unclassified by default and is also white, the lines would not be visible when defining the area. So, we immediately changed the color of the cloud for ease of operation.
Now we will prepare the point cloud for DSM/DEM generation and the first step is to remove unnecessary points and noise. To do this, we will display the cloud from the side view. For this purpose, it is necessary to:
- Add another view window by clicking on “2” in the “View Toggles” menu, as shown in Figure 12.
- Click on “Tile” 1 to place the windows side by side. Then click on “View 2” to make it active, and change the view to “Right View” 2, as shown in Figure 13. As you can see there is a lot of noise in the point cloud that needs to be removed.
To remove the noise, we can use the same tool we used earlier (“Fence Tools”) or we can use classification to automatically detect the noise. In this case, we will use both tools. For rough cleaning we will use “Fence Tools”, but now we will delete points that are inside the selection area: “Point” -> “Delete” -> “Inside fence”. As a result, the point cloud will look as shown in Figure 14.
As you can see, most of the noise has been removed, but not completely, so we move on to classification for better cleaning.
Classification #
To classify points the following is necessary:
- In the menu “Classify” -> “Routine” selects the desired type of classification. First, we will remove the points that are below the surface level. To do this, click on “Low points…”, Figure 15.
- A window with classification parameters will open, as shown in Figure 16. In this window, you need to adjust the parameters, as they are essential for accurate classification.
- Select the desired class “Class 0” from the drop-down list. The program has automatically selected the class to which the points “7 – Low Point” will be assigned.
- In this case we will search for single points that are farther than 0.1 m from the other points, so change the parameter next to the “More than:” field to 0.1 meters. Click “OK”.
As a result, the noise that is “under the cloud” is classified as a “Low point”. The program automatically highlighted them in red for better visibility, as shown in Figure 17.
- If after the “Low point” classification in automatic mode there are points that can also be classified as “Low point”, but they were not determined by the program (this is due to the parameters), then they can be conveniently and quickly deleted manually. To do this, you will need the toolbox, which is available from the menu “Tools” -> “Toolboxes” -> “Model” in the Terrascan window. The appearance of the toolbox toolbar is shown in Figure 18.
- Click on the icon shown in Figure 19 to select the “Classify Below Line” tool. In the window that opens, select the class whose points will be placed in “Low Points”.
- After that, draw a line over the points that we want to classify, as shown in Figure 20. Click in the desired place in the point cloud to confirm the operation.
- The points under the line will be classified as “Low Points”, as indicated by the color of their selection, as shown in Figure 21.
In the same way, we classify “Isolated Points” with the parameters that are shown in Figure 22. The result of the classification is shown in Figure 23.
- Remember that for your dataset the suitable parameters may be different!
- Now we will delete these points using the menu “Point” -> “Delete” -> “By point class…” as shown in Figure 24.
- A window will open with the existing point classes, Figure 25. Select “Low point” and click on “OK”. The selected points will be deleted.
- Repeat the procedure for the “Temp 1” class.
After cleaning you should classify the surface points, called “Ground” points. We used the parameters shown in Figure 26. The result of the classification is shown in Figure 27. For this display, you should go to “View” -> “Display mode” and leave a checkmark on the class you want to keep for display, then click on “Apply”.
Since we are satisfied with the result, we can proceed with DSM/DEM generation.
Point Cloud to Digital Elevation Model and Digital Surface Model
To generate a DEM, follow these steps:
- Click on the menu “Output” -> “Create surface model…”, Figure 28.
- In the window that opens, as shown in Figure 29, select the class and click “OK”.
- The surface creation settings window will open, as shown in Figure 30. Select the parameters and click “OK”. A window opens to select the file path, name, and model type. Select the type “Ground” and enter a name, then click “OK” as shown in Figure 31.
The created model will then be displayed in the list of models in the TerraModeler window, as shown in Figure 32.
- In the “TerraModeler” window in the “File” menu click on “Export” -> “Raster image”, Figure 33. The window shown in Figure 34 will open. In this window, you can customize the export parameters. We will export to GeoTIFF with a grid spacing of 0.01. The rest of the parameters we leave by default.
- In the opened window specify the path where we want to save the GeoTIFF file.
The same procedure will be used to obtain DSM, but “Any Class” is selected when selecting the class of points for model creation. Therefore, we will not dwell on this in detail but just demonstrate the result, in Figure 35, and Figure 36.
Now we will proceed to the generation of contours.
Point Cloud to Contour #
We will use our point cloud, which already has “Ground” point classification, to generate the contours. Now we will export these points to a text file. To do this you need to:
- Click on “Output” -> “Export lattice model…” as shown in Figure 37.
- The window shown in Figure 38 will open. Here we have to make sure that the class “Ground”, “Triangulated model z” and the file format “Xyz text” are selected.
- A window will open in which you should specify the path and the name of the file to be saved, we called it “ground_points.xyz”.
- Close the current point cloud by clicking on “File” -> “Close points” as shown in Figure 39.
- Then open our file with saved ground points “ground_points.xyz”. In our case, the result is shown in Figure 40.
- Now we will create a model based on the loaded points. To do this, click on the icon shown in Figure 41.
- The window shown in Figure 42 will open. Here we specify “1 Default” because in this case our points have been automatically assigned to this class, unlike the point cloud which had “class 0” by default. Click on “OK”.
- After that our model has been successfully created and we will generate contours from it. To do this, click on the icon shown in Figure 43.
- The window shown in Figure 44 will open. We will save our contours to a file by selecting the “Write to file” mode and enabling “Line Strings” rendering. Leave the other parameters unchanged. Click “OK”.
- After data processing in the program window, we will see the contour and the model in the list of models, Figure 45. To explore the surface, increase the zoom, Figure 46.
- vTo remove the contours from viewer window, click on a tool for drawing contours and click on “Erase Display” tool. The window shown in Figure 47 will open. Click on “Erase contours” and click “OK”. After this, the contours will be removed from the viewing window.
We will now look at the process of obtaining accuracy reports for our point cloud and DSM/DEM models using GCPs.
Reports #
Control Point Report #
The Control point report tool outputs an accuracy report between the point cloud and the independently surveyed control points and checkpoints. These values can then also be used to manually register the point cloud to the desired altitude values.
To get an accuracy report you need to:
- Click on “Tools” -> “Output control report…” menu, Figure 48.
- The window shown in Figure 49 will open. Here you can enter the path to the file with the control points, select the class, the type of control (in this case height is selected), and the parameters to be calculated (we left them unchanged). Click “OK”.
- Once the accuracy has been calculated, the window shown in Figure 50 will open. The window will show the control points and the difference between the point cloud and the control point. At the bottom of the window, you will see the average accuracy, the minimum and maximum values, as well as the STD, and RMS.
- To immediately apply the calculated shift to the point cloud, click “Apply” -> “Elevation shift…” in the menu. The window shown in Figure 51 will open, where you can select which points the shift will be applied to. We will apply the shift to all loaded points, so click “OK”.
- After this, the shift will be applied to the entire point cloud, and the values in the “Control report” window will change taking into account the shift. The result of the operation is shown in Figure 52.
- This information can be saved as a text file. To do this in the “Control report” window click on “File” -> “Save as text…”. Then in the opened window select the path where the report will be saved. If you open the report for viewing, it will look as shown in Figure 53. The content of the text file completely duplicates the content of the “Control report” window.
The saved report can be easily distributed to clients.
DEM/DSM Accuracy Assessment #
- To get the DSM/DEM accuracy report, select the desired model and go to the menu “Utility” -> “Output control report…” as shown in Figure 54.
- A window will open as shown in Figure 55, where you set the path to the file with control points, as well as the accuracy thresholds for the validity of the points. After selecting the file and setting the parameters, click on “OK”.
This will open the familiar window with the accuracy information for each control point, Figure 56. As for the point cloud, this information can be saved to a text file for later use. To do this, click on “File” -> “Save as text…”.
The report for the DSM is generated in the same way.