Beginner’s Guide to Working with LiDAR Point Cloud Data using LAStools

Ana Diaz
12 min readJan 30, 2023

Specifically, how to view, classify, and process LiDAR data using LAStools

Table of Contents

LiDAR Overview

Introduction to LAStools

Visualizing the point cloud

Classification of LiDAR Points

LiDAR Derivatives

More Resources

LiDAR Overview

Before we get started, it is important to understand the data we will be using. So what is LiDAR data?

LiDAR stands for Light Detection and Ranging and is an active remote sensing system. Active remote sensing systems are systems that generate energy to measure things on the ground. In the case of LiDAR, light is emitted in pulses to the ground. A LiDAR sensor can emit greater than 100 000 pulses/ SECOND, and travel at the speed of the light and are emitted at high densities! Naturally, these pulses reflect off objects along the way like buildings or trees and find it’s way to the sensor.

The reflected light that gets recorded by the sensor is called the return.

One light pulse emitted can generate multiple returns. How? Picture this, one packet of light is racing towards the ground until it encounters the edge of a leaf on a tree. Half the packet of light reflects off the leaf back to the sensor; this would be the first return. The rest of the packet continues along the same trajectory until it hits the ground and it reflects back to the sensor (last return). This is why LiDAR is so good at characterizing the density and structure of trees. There are so many different applications to LiDAR so if you are curious check out this page.

The sensor measures the time it took each return to return to the sensor. The time is then used to calculate the distance of the sensor to the object. To calculate the distance, the system has 2 components:

  • a GPS that identifies the x, y, z position of the light pulse
  • Inertial Measurement Unit (IMU) which provides the orientation of the system whether it is on a plane in the sky (normally called airborne LiDAR and is the most common), or a satellite (like NASA’s GEDI instrument onboard the International Space Station).

Extracting Returns

Some definitions:

Waveform: A LiDAR waveform is the distribution of energy that returns to the sensor,

Intensity: the amount of energy returned to the sensor

The image below is an example of the waveform of a pulse that goes through the tree. It shows the intensity of the return in terms of time. The first returns are from the crown of the tree (the first peak) then the the intensity decreases and increases again when the light reaches the understory and then the last peak is from the ground returns. Different structures would have different waveforms, a skinny tree in the winter or with less leaves will have more of ground return and a smaller first return.

Image 1: An example tree and its waveform

Intensity Factors

The intensity varies because of varying surfaces. For example, vegetation usually has low intensity because the light scatters which reduces the amount of light that return to the sensor. A really smooth surface would have a high intensity because the scatter would be low and the reflection high. The intensity also increases as the distance of the object to the sensor decreases. So, a smooth rooftop would have a higher intensity return than a smooth ground just because it is closer to the sensor.

Types of LiDAR

A LiDAR system that measures and stores the full waveform is called a Full Waveform System. Because it stores the distribution for each pulse and there are millions of pulses, processing this data can be intensive. Discrete LiDAR systems only store the first, last and intermediate returns. This is what we will be using and is most commonly available. A collection of points is called a LiDAR point cloud because quite literally it looks like a cloud of points.

LiDAR File Formats

LiDAR point clouds are so large that they have their own file format extension .las. The compressed file format is .laz

LiDAR points come with attribute information. Normally, they have the x, y, z (elevation) values. Most datasets have the intensity values and sometimes they have a classification meaning the points were assigned a category like building, vegetation, ground etc. This is useful because it helps make sense of the data and to visualize the point cloud.

The header of the .las contains the metadata on the sensor, the angle, the swath width, number of pulses, points etc.

Don’t worry if your LiDAR data doesn’t have a classification, you can classify it yourself. Skip to the classification section to view how to do it.

Introduction to LAStools

LAStools is an open-source Lidar software package that primarily uses the command line for LiDAR processing. It is a set of small modular .exe files and corresponding text files that explain what each executable file does. They can be run through the command prompt or you can run them through a basic GUI (Graphical User Interface).

You can download LAStools through here this link.

If you have a mac, you won’t be able to download it directly. Instead, the LAStools package is available in QGIS version 3.10 or higher. If you don’t have QGIS download it from here. If you have an older version of QGIS you can install LAStools through QGIS following this tutorial.

The rest of this guide will be specifically for windows users. Mac users beware.

Data

The data I will use is the France.laz file within the data folder in LAStools the folder. This is an example dataset. Feel free to follow along with another example dataset in the folder or your own dataset.

LAStools Folder Structure

Once you have downloaded LAStools, unzip it, and open the folder. The contents should look something like the image below:

All the individual tools are found within the bin folder. These can be run in the command line or by running each .exe. The same tools are packaged differently so you can run them in different programs, for example the ArcGIS-toolbox or the QGIS-toolbox in LAStools are toolboxes that you can use via ArcGIS or QGIS.

I normally have a working folder with the data I will be analyzing and then copy the tools I need from the bin folder to my working folder. My working folder currently contains:

  • the dataset (france.laz)
  • lasinfo.exe and its readme.txt
  • lasview.exe and its readme.txt

GUI of LAStools

Within your working folder click lasview.exe. You’ll see a simple GUI show up

Each tool, if you open it through the executables, will have the same left and bottom panel highlighted in red. That doesn’t change. The right panel, on the other hand, is specific to the tool. This is where you can input the tool parameters.

To load the data in, expand the browse menu on the left-hand side and find the folder with your data. To go up a folder double click the second /.

Once you click on your point cloud data, you’ll get a teal rectangle like the image below. DON’T PANIC!

This is normal

The teal rectangle is bounding box of the LiDAR. It can help organize the different extents of multiple LiDAR datasets all from the same area.

Metadata

On the left panel, you can see the metadata for the file, containing the number of points, if it has a projection etc. If you minimize the browse menu, the metadata will be in full view and you can see that france.laz does not have a projection. If your data also doesn’t have a projection it’s ok; you can add a projection or reproject your LiDAR data later.

COMMAND PROMPT ALTERNATIVE:

In the command prompt, I change my directory to my working folder, cd /workingand then run lasinfo France.laz -cd

It will return the header information within the las file and the -cd option computes the point density as well. This will be important in the future when we classify the point cloud.

Opening the las file in lasviewer

After reading the metadata, click view on the right hand side. A window will popup with the command line code.

Only until you hit start will you able to see the LiDAR Points in the las viewer.

Why did it take so many steps to just open a file?

Because LAStools was meant to be used from the command prompt which is why the GUI looks ancient. The command line is much faster than going through the GUI which is why the following processing and analysis will be through the command prompt. But I wanted to show the GUI too for those that are more visual.

COMMAND PROMPT ALTERNATIVE:

To view the point cloud, use the following command lasview france.lazor if you have multiple LiDAR files and you want to display them together lasview filename1 filename2 -merge

Visualizing the point cloud

We have reached the fun part! Within the lasview window, you can visualize the point cloud in so many different ways:

Right click anywhere to see the visualizations options (I will go through a few)

1.a) Color by Return

This will colour the points based on an attribute.

  • single returns are yellow, and for multiple returns red = first return, blue = last return, green = intermediate return
Colour by return: Vegetation has multiple returns whereas building only have 1 return

1. b) Colour by intensity

Point cloud coloured by intensity: Vegetation has a lower intensity (darker) because of the scattering of the pulses

1. c) Colour by elevation

2. Play and Step

This will show how the aircraft gathered the points. The order might be important if it means there is a higher concentration of points in certain areas compared to others in your dataset.

3. Triangulate

This will calculate a Triangular Irregular Network (TIN) and show the point cloud as 3D. (See las2dem Explanation section for more information on a TIN)

Play around with the menus and the visualizations. Don’t be afraid to click around.

LasViewer Controls and Shortcuts

Click space to change the navigation setting on the top left: pan, zoom, translate, tilt or:

Currently it is in the ‘pan’ mode
  • Alt click to pan
  • Shift click to translate
  • Ctrl click to zoom

Some Shortcuts:

  • + to increase the size of the points,
  • = to reduce the size of points,
  • x to examine a cross section, x again to isolate that cross section
A cross section of France.laz. Clicked x twice and user arrows to move the cross-section

Classification of LiDAR Points

To classify the points, we will extract the buildings, trees, and the ground. This will be a three-step process.

My working folder has lasground.exe, lasheight.exe, lasclassify.exe as well as my data France.laz and lasinfo.exe and lasviewer.exe.

1. Run lasground

This tool classifies points as ground (class 2) and non ground points (class 1). This tool is specifically made for airborne LiDAR. If your dataset is terrestrial LiDAR, you can use the -not_airborne option in the command line. By default the tool only classifies the last returns. You can change it by requesting -all_returns. For cities, use -ultra_fine -city options

-v means more info will be displayed on the console, -i is for input followed by input file name, -o is the output followed by output file name.

Be sure to change the input and output filenames!

lasground -v -i a_lasfile.las -o lasfile_lasground.las -ultra_fine -city

Intermediate Result: The ground points are brown(class = 2), everything else is black (class = 1)

2. Run lasheight

This tool computes the height of each point above the ground assuming that grounds points have been classified as 2 from the previous step. Should be run after lasground.

lasheight -v -i lasfile_lasground.las -o lasfile_lasheight.las

Intermediate Response: showing the heights

3. Run lasclassify

This tool classifies buildings and vegetation by finding neighboring points that are at least 2 meters (or 6 feet) above the ground (calculated by lasheight) and form -planar 0.1(= roofs) or -rugged 0.4 (= trees) regions.

If the point density is low (< 2 pulses per m²), it might cause the tool to fail. If this the case with your dataset (see the metadata), change the minimum of distance of neighbouring points from 2m to 4m with -step_4

lasclassify -v -i lasfile_lasheight.las -o lasfile_lasclassify.las -step 4 -planar 0.1

Classified Results. Black points are not classified and can be manually edited in lasviewer.

Automation Potential

You can store these commands in a text file and save as a batch file into your working folder to run all of them at once. A batch file is a script file that contains commands the command line interpreter will run. I would recommend Notepad++ to do this.

LiDAR Derivatives

With LAStools you can create rasters derived from LiDAR like a DEM (Digital Elevation Model), DSM(Digital Surface Model), a tree height raster, a relative building and tree height raster etc.

I will only illustrate how to create a DEM and a DSM. But first, what is the difference between the two? A DEM is the elevation model of the bare earth, not including trees and buildings while a DSM captures the natural and built environment as well as the ground.

For both models the las2dem tool will be used. The las2dem requires a classified point cloud and the output will be a DEM or DSM depending on the tool options.

The tool works by creating a temporary TIN (Tringular Iregular Network) from all points in the LAS file. Then, it rasters the elevation values of each TIN facet onto a grid with a step size of 2 (a 2m grid), and stores the resulting DEM in ASC format.

Oof…. that was dense. Let’s break it down:

las2dem Explanation

A TIN is a representation of a continuous surface made entirely of triangular facets. Something like this:

A TIN

Each triangular facet stores the nodes and its coordinates, the neighbouring triangles, the interpolated elevation of the 3 nodes, the slope and the aspect. Interpolation is estimating new values from neighbouring points; think of it like a spatial average.

Once the TIN is created, which will look something like FIGURE X, a grid of step size will be created because a raster is within a grid format. The elevation for each facet is then stored in the grid square it overlaps. If there are multiple facets a weighted average of the elevation is used.

Then the tool outputs a .tiff of the elevation.

Tool Options:

-step 0.5 specifies the grid at which the interpolation of the TIN will occur. Normally want this to be the separation of the points in your dataset

-kill 200 is so that it does not raster triangles created by the TIN with edges longer than 200 meters ( the default is 100m ). This is done so that large triangles around the edges do not influence the raster

-keep_class 2 this is the option that creates the DEM. If you remember LiDAR points classified as 2 are the ground points from lasclassify. So this option is creating a raster from only the ground points. A DSM would not have this option.

More options:

You can add a shapefile with elevations of a breakline to enforce those boundaries in the raster that is being created. For example, if your dataset has a lake boundary and you have the DEM/DSM has the proper elevations of the boundary, you would use the option -lakes name.shp. Read the documentation for more options.

DEM code

las2dem -v -i lasfile_lasclassify.las -o lasfile_dem_BL_10cm.tif -step 0.1 -kill 200 -keep_class 2

DEM symbolized in QGIS

DSM code

las2dem -v -i a03_lasfile_lasclassify.las -o a05_lasfile_dsm_10cm.tif -step 0.1 -kill 200

DSM Results opened in QGIS

Interpretation

As you can see, the DSM is more useful to see structure, vegetations and even powerlines. The resulting tiff is easier to interpret compared to the DEM. In this case the DSM would be more useful. This doesn’t mean that DSMs are better than DEM. It just depends on your data, the subject and your research questions/ purpose.

Troubleshooting

To open the tiffs, I recommend using a GIS like ArcGIS Pro or QGIS. Opening it on the default program on your computer may result in a blank screen

Conclusion

This is it for the introduction to LAStools. Even though this introduction is by no means an exhaustive resource, I hope it was useful. :)

Here are more resources:

Google Group for LAStools

RapidLasso Product Information

LAS File Format Wiki

In depth LAStools Tutorial Videos

--

--