Preparing your Classified LiDAR dataset - BuildTheEarth/terraplusplus GitHub Wiki
This guide will teach you if your LiDAR data contains classified points, ex. ground points, vegetation, buildings... If it does, it will then teach you how to export only the selected classified points, within a range/interval.
A: Prerequesties
- Download and install CloudComapre v2.11 from here
- Download and install the latest version of QGIS in OSGeo4W
B: Identification
- Open CloudCompare and go to
File/Open
- In the
Open file dialog
make sure to selectLAS cloud (*.las *.laz)
as the filter - Select one las/laz file and open it
- In the open window click on
Apply all
- In the next window
Global shift/scale
click onYes to All
- Once it imports the cloud, click on the cloud name in the top left panel, like shown on the image above. This selects the cloud.
- In the bottom left panel called
Properties
, scroll down to the section calledScalar Fields
- Here click on the dropdown menu
Active
- If the opened menu contains an entry called
Classification
your LiDAR data contains classified points, and you can continue
C: Classification index
- Keep the dropdown menu open and from the entry below
None
, start counting, starting at 0 until you reach theClassification
entry - In the example shown in the above image, this number would be 5, as shown on the index values on the left of the dropdown
- Next, click on the entry
Classification
to make it active - The reason why we start counting at 0, is because 0 is always the starting index, meaning in the above example
ScanAngleRank
is the starting index - Once you find the index, note it down
D: Classification range
This next step will be a little trickier, as every dataset orders its classifications differently. To make your life easier, I've included 2 examples. Here we will need to define the minimum and maximum values for the classification range.
- In the same panel, scroll down to the section called
SF display params
- Here you fill a slider and two textboxes defining the min and max value
Example #1
The above example is simple, as it only contains two classifications (ground points and DSM). As there are two classifications, CloudComapre simply used 2 steps (2 two colors [green and blue]). What does this mean? The values on the slider are defined into two parts. The first part (between 1.0 and 1.5) is the DSM classification, while the second part (1.5 to 2.0) is the ground classification. We want the second part, so in this case, we would note down 1.5 as the minimum values and 2.0 as the maximum value.
We can test this out, by sliding the slider start to the middle and leaving the ending alone. As you can see in the above image, only the ground points are now colored (green points), while the DSM points are now grayed out.
Example #2
Let's take another example with a point cloud that has more classifications. As you can see in the above image, the dataset classification table consists of 11 classifications. We only want to extract the ground, so we set the starting value to 2.0 and the ending value to 11.0 which become our minimum and maximum value. As you can see on the 3D View, only two colors are shown (green and blue representing the ground), while the rest, representing other classifications are grayed out.
If you are not sure, to which number set the starting and ending value, you can play around with the slider until only the ground is colored. To navigate around the point cloud, use the scroll wheel to zoom, left-click and holder to rotate, and right-click, hold and move the mouse to move around. Just make sure your minimum and maximum value fall directly on your selected starting and ending interval/break (as shown with the vertical lines under the slider).
E: Back to the first part
- Once you've gathered the classification index, classification minimum, and maximum value, you can continue on with Part one: Preparing your dataset, starting at step B.
- The only difference is, that once you open the
export_dem_classification.py
script, besides setting up the usual input and output path, you will need to change the variablemin_range
(line:17) value to your classification minimum value, the variablemax_range
(line:18) value to your classification maximum value and the variablescalar_index
(line:19) value to your classification index. The script also offers an option to set the projection to the exported dem, by setting thedem_epsg
(line:22) variable to the desired EPSG code.
Need help or have a question?
You can contact me on Discord, under davixdevelop#3914
, or you can join us on our BTE Development Hub on Discord, and ask away under the #terraplusplus-support
channel.