qpals Line Modeler

As part of the opalsGeomorph package, a workflow and modules for the semi-automatic detection and extraction of terrain breaklines was developed. This workflow (c.f. Mandlburger et al. (2016)) is represented as a submodule of qpals in the form of a step-by-step wizard. It can be started by navigating to qpals-LineModeler in the QGIS menu bar.

Input

Two different inputs are possible: A classified/filtered point cloud in any of the formats supported by opalsImport (e.g. las/laz, odm) or a digital terrain model (DTM). The terrain model should be free of any void areas. Depending on the input dataset, the terrain model will first be converted to a point cloud or vice-versa. Also, the terrain model itself and a shading will be added to the QGIS canvas.

Detection of 2D-Breaklines

For the breakline detection, a slope map is calculated from the DTM using opalsGridFeature. On this slope map, edge detection is carried out using the Canny (1986) algorithm. Two parameters of the opalsEdgeDetect module greatly influence the result:

  • sigmaSmooth: Canny's algorithm contains a smoothing step with a gaussian kernel. The sigmaSmooth-Parameter controls the level of this smoothing, a high value will smooth the DTM more than a low value. This will result in fewer edges detected, and may help to eliminate minor breaklines or breaklines on small structures.
  • threshold: This two-valued parameter defines the lower and upper threshold for Canny's detection algorithm. Within the whole image, pixels that have a slope bigger than the upper threshold are selected. From those, the detected lines are prolonged until a pixel with a slope smaller than the lower threshold is encountered. This is called hysteresis. The choice of threshold values will affect the result in the following ways: A larger upper threshold will result in fewer lines overall, only leaving those with a higher [maximum] slope difference between the involved surfaces. A larger lower threshold results in shorter lines, only concentrating the lines on the steepest slopes.

We suggest playing aroung with the parameters a bit and trying out different combinations.

After the detection with opalsEdgeDetect, the breaklines are vectorized (opalsVectorize) and then cleaned topologically with a three-step approach in opalsLineTopology:

  1. Find the longest possible connections, iteratively (global optimum)
  2. Merge lines that end close to each other and have a similar direction (local optimum)
  3. Again, find the longest possible connections, and eliminate short lines (global optimum)

The parameters snapRadius and maxAngleDev in step two will have the most impact on the local line connections and the required manual labor in the next steps. The third step will mostly remove lines shorter than minLength.

Editing the 2D-Breaklines

The pixel-based edge detection approach cannot fully recreate the 2D-detections required to correctly model the terrain breaklines. Especially in rough terrain, or where two or more breaklines are close to each other, errors might occur, which should be corrected. Since editing in 2D is much easier than in 3D, it is suggested to do this editing before the 3D Modelling. The following are typical cases where manual editing is suggested:

  1. Connecting logically continuing lines
  2. Resolving connection issues concerning upper/lower slope rim
  3. Removing unimportant/wrong lines due to erraneous DTM
2D-Approximations before and after editing

To help with the 2D-Editing, two tools are provided with qpalsLineModeler:

  1. quickLineModeler: The quickLineModeler allows the user to select a few lines (using QGIS' select function). Those lines are then modelled using the opalsLineModeler module with default parameters. The result is loaded into QGIS as 3D lines and can be visualized using qpals Section GUI.
  2. qpals Section GUI: This tool will load data from the pointcloud in a selected rectangular area and display it as a 3D plot. The modelled 3D breaklines can also be visualized. For more details, see the documentation of the qpals Section GUI.

After editing, make sure to save any changes made to the layer.

3D Modelling

This step contains the core modelling function. Using opalsLineModeler, the 2D approximations are modelled in 3D using the point cloud (or DTM). The processing might take some time, depending on the number of points and lines. No new lines will be added, but the approximations may be shortened and in turn eliminated due to short length, if the 3D intersection does not provide sufficient results. For parameter options and configuration, please refer to the documentation of opalsLineModeler.

Quality and topology checks

After processing, two different validation/quality checks can be carried out:

  1. Height comparison: The height for each node is compared to the height of a terrain model, interpolated bilinearly. While the difference should not be zero (otherwise the lines would not have any effect), large offsets may point to modelling errors. 0.5 m height difference is a plausible threshold.
  2. Topological and natural continuity: The lines are checked for intersections, double segments, double nodes, overlapping segments and lines ending within 5 cm from another line (small gaps). Additionally, all acute angles are exported as they will only occur in very special cases of terrain. The created dataset has an attribute "TYPE" representing the different types of issues.

The qpalsLineModeler contains a script to automatically check those issues. They may then be resolved by selecting the layer with the modelled lines and the "problems"-point layer. The following options are available for resolving:

  • Snapping the node height to a terrain model, using bilinear interpolation ("Snap to")
  • Removing the node (without breaking the line link) ("Remove")
  • Changing the node's coordinates (2D/3D) using QGIS' Node Tool. The node is automatically selected and centered when clicking the "Prev point" or "Next point" buttons. Click and drag in the canvas to change the position, or change the Z coordinate in the Vertex Editor within the LineModeler GUI.

Note that is not neccessary to correct all of the problems listed above. In some cases, the modelled lines might be correct, but they will still show up as a problem. It is up to the user to decide, which nodes/lines to keep and which ones to change.

After saving the changes, the result can be exported to a different location. The standard export format is ESRI Shapefile, however, Shapefiles cannot transport the full information created during the modelling process, such as segement-wise intersection properties (angle of intersection, surface types, ...). This information is stored in the temporary directory as an odm. It can be accessed e.g. using the Python Bindings of the OPALS Datamanager Library.

References

Author
lwiniwar
Date
06.11.2017