This repository provides a complete pipeline for processing LiDAR point cloud data, performing classification using RandLA-Net, generating Digital Terrain Models (DTMs), and conducting hydrological analysis for drainage network assessment.
The workflow includes:
- Model Setup (RandLA-Net)
- Pre-processing of Point Cloud Data
- Point Cloud Classification
- Post-processing and Export
- DTM Generation (COG format)
- Hydrological Modelling & Drainage Analysis
The model setup and environment configuration should follow the official RandLA-Net PyTorch implementation:
https://github.com/idsia-robotics/RandLA-Net-pytorch
Please ensure all dependencies (PyTorch, CUDA, etc.) are properly installed.
Before running classification, download the pre-trained model:
Steps:
- Download the
.zipfile - Extract the contents
- Place the extracted folder in:
data/saved_models/Each point cloud must be stored in a separate folder following a strict structure:
data/
│
├── pc_id=1/
│ ├── pc.pickle
│ └── metadata/
│ └── metadata.pickle
│
├── pc_id=2/
│ ├── pc.pickle
│ └── metadata/
│ └── metadata.pickle
-
Each folder must be named as:
pc_id=<integer_id> -
Inside each folder:
pc.pickle→ contains the point cloud datametadata/metadata.pickle→ contains metadata information
Convert raw .laz point cloud files into .pkl format required by the model:
python pc2pickle.pyRun the trained RandLA-Net model for classification:
python test.pyEnsure that:
- Pre-trained model is placed in
data/saved_models/ - Dataset follows the required folder structure
- File paths are correctly specified
- Model weights are properly loaded
Convert classified .pkl outputs back to .laz format:
python pickle2pc.pyYou can skip intermediate steps and directly process .laz files:
python test_laz.pyThis will:
- Perform classification
- Directly generate classified
.lazoutput
Generate Digital Terrain Model (DTM) in Cloud Optimized GeoTIFF (COG) format:
python las2cog.pyPerform hydrological analysis and drainage network extraction:
python waterlogging.pyThis script performs:
- Depression filling
- Flow direction computation
- Flow accumulation
- Natural drainage network extraction
- Overlay of streams on identified hotspots
- Detection of unconnected hotspots
- Proposal of alternate drainage network
- Save all layers in folder "outputs"
You can visualise each layer before saving as output during hydrological analysis and drainage network extraction:
python waterlogging_with_visualisation.pywaterlogging.ipynb is also provided, which you can run in Google Colab or Jupyter Notebook to understand and visualise each layer at different steps of the hydrological analysis.
-
Computing: GPU-enabled system (recommended)
-
Software Stack:
- PyTorch
- GDAL
- WhiteboxTools
- CloudCompare
- QGIS
-
Data: High-resolution LiDAR point cloud datasets (
.laz)
- Ensure coordinate systems are consistent across all processing steps.
- Strictly follow dataset structure to avoid runtime errors.
- Large datasets may require significant memory and processing time.