DTM and DSM from point cloud in R

We have already written how to load a point cloud in R. Today we will show you how to use lidR tools to generate DTM and DSM. You can download free data from Polish GeoPortal. We will use the drone match data from one of our previous posts. You can download the data here.

First, let’s load our point cloud into R using the lidR package:

Point cloud looks like this:

To create a Digital Terrain Model (DTM), we need points that are on the ground. We can classify the data into ground and non-ground using the lasground function with the CSF algorithm, which we already know from CloudCompare:

The colored cloud after classification looks like this:

We generate the DTM using the grid_terrain function and define the resolution (res) and the generation algorithm (in our case a TIN grid):

The function selects the ground points themselves and generates a grid from them. The generated DTM looks like this:

The grid_canopy function is used to generate the DSM. We need to specify the resolution (res) and the algorithm to generate:

Our resulting DSM looks like this:

The functions presented to you today have many more detailed features to enhance the final product, such as filters or the ability to change the parameters of the algorithms that generate the output grids. We encourage you to take a closer look 🙂

Leave a Reply

Your email address will not be published.

Translate using Google Translate»
Social media & sharing icons powered by UltimatelySocial

Podoba Ci się nasza strona? Odwiedź nasz profil