- Linux (tested on Ubuntu 20.04.4 LTS and 21.10)
- PDAL 2.4.2
- plyfile (NumPy-based text/binary PLY file reader/writer for Python)
conda install -c conda-forge pdal plyfile
The script crop the input las, segment the ground points and then reconstruct the terrain surface as an .obj surface:
./terrain_reconstruction_csf.sh INPUT_FILE_1 ... INPUT_FILE_N OUTPUT_FILE
where INPUT_FILE_1 ... INPUT_FILE_N are the .las/.laz files containing the scans of the plot and OUTPUT_FILE is the path to the .obj output surface Note: the extent of the ground reconstruction and the parameters of the CSF algorithm must be adjusted in the header of terrain_reconstruction_csf.sh
The pipeline is made of the following steps:
- Every input las files are cropped on an user defined extent (they are also subsampled to the desired DTM resolution in order to speed up the processing)
- The resulting cropped point clouds are merged
- The Cloth Simulation Filter (CSF) classifies the ground points.
- The DTM raster is exported
- A surface model (PLY format) is reconstructed from the ground points
- The PLY surface model is converted into an OBJ
Additionnaly, we propose a second script, designed to reconstruct a terrain surface from Ground points already segmented.
./terrain_reconstruction_from_ground_points.sh INPUT_FILE_ASCII INPUT_FILE_OFFSET OUTPUT_FILE
INPUT_FILE_ASCII is a point cloud stored in ASCII format where the first 3 columns are XYZ coordiantes separated by space characters. INPUT_FILE_OFFSET is an ASCII file storing the X and Y values of the offset applied to the point cloud OUTPUT_FILE is the path to the .obj output surface.
The pipeline is made of the following steps:
- Filter the first 3 columns of the ASCII file
- Transform the ASCII file into a LAS file and apply the transformation related to the offset
- A surface model (PLY format) is reconstructed from the ground points
- The PLY surface model is converted into an OBJ
If PDAL outputs the following error while reading the .las files
Global encoding WKT flag not set for point format 6 - 10
It means that the LAS file is missing a Spatial Reference System. To fix it, run:
python fixLasFile.py INPUT_FILE