A Python package for 3D LiDAR point cloud processing, analysis, terrain modelling, and visualization.
Project description
LidarLens
LidarLens is a powerful Python package for processing, analyzing, and visualizing 3D LiDAR point cloud data. It provides a clean, pythonic API for common tasks such as I/O, noise removal, ground extraction, DTM/DSM generation, and terrain analysis.
Features
- I/O: Read and write LAS/LAZ files (wraps
laspyandopen3d). - Preprocessing: Voxel downsampling, statistical/radius outlier removal.
- Segmentation:
- Ground extraction using CSF (Cloth Simulation Filter) or RANSAC.
- Building and vegetation segmentation (heuristic).
- DBSCAN clustering.
- Terrain Modelling:
- Generate DTM (Digital Terrain Model) and DSM (Digital Surface Model).
- Compute Canopy Height Models (CHM).
- Generate vector contours.
- Analysis:
- Point density maps, roughness, slope, aspect, and hillshade.
- Cloud-to-cloud distance comparison.
- Volume computation and cross-section profiling.
- Geometry:
- Normal estimation and orientation.
- Mesh surface reconstruction (Poisson, Ball Pivoting).
- ICP Registration.
- Visualization: Helper functions for plotting point clouds, DEMs, and histograms.
- CLI: Comprehensive command-line interface for batch processing.
Installation
pip install lidarlens
To install with CLI support:
pip install lidarlens[cli]
To install with Deep Learning support (coming soon):
pip install lidarlens[dl]
Quick Start
Python API: DEM Generation Pipeline
This example demonstrates how to import a raw point cloud, remove noise, classify ground points, and generate a Digital Terrain Model (DTM).
import lidarlens as ll
# 1. Import Data
# Load your point cloud file (supports .las and .laz)
# Returns the point cloud, header, VLRs, and coordinate reference system (WKT)
pcd, header, vlrs, wkt = ll.read("raw_scan.laz")
print(f"Loaded {header.point_count} points")
# 2. Data Processing
# Remove statistical outliers (noise removal)
pcd_clean = ll.denoise(pcd, method="statistical", nb_neighbors=20, std_ratio=2.0)
# Downsample to 0.5m voxels for faster processing
pcd_down = ll.downsample(pcd_clean, voxel_size=0.5)
# 3. Ground Extraction
# Separate likely ground points from non-ground objects
ground_pcd, non_ground_pcd, plane_model = ll.extract_ground(pcd_down)
# 4. Generate DEM (Digital Terrain Model)
# Rasterize ground points into a 1.0m resolution grid
dtm, meta = ll.generate_dtm(ground_pcd, resolution=1.0)
# 5. Visualize and Save
# Save as a colorized PNG for quick visualization
ll.dem_to_png(dtm, meta, "output_dtm.png", colormap="terrain")
# Export to GeoTIFF for use in GIS software (requires rasterio)
# We pass the 'wkt' to ensure the output is properly georeferenced
ll.dem_to_geotiff(dtm, meta, "output_dtm.tif")
Command Line Interface
# Info
lidarlens info input.laz
# Processing pipeline
lidarlens downsample input.laz -v 0.5 -o downsampled.laz
lidarlens denoise downsampled.laz -o clean.laz
lidarlens ground clean.laz -o ground.laz
# Terrain products
lidarlens dtm ground.laz -o dtm.png
lidarlens contours ground.laz -i 2.0 -o contours.geojson
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lidarlens-0.1.4.tar.gz.
File metadata
- Download URL: lidarlens-0.1.4.tar.gz
- Upload date:
- Size: 37.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6717512c45c3d48a9e484ccf3bc9e9b58efb048e7413dcdb4764890f225dac81
|
|
| MD5 |
bba5fd7fdfcb4c8c9a9269c36c9fc541
|
|
| BLAKE2b-256 |
294c5fddca9cc597fb91382ad1ac00143e925afaaec22b3a8dfbe40db3c837bf
|
File details
Details for the file lidarlens-0.1.4-py3-none-any.whl.
File metadata
- Download URL: lidarlens-0.1.4-py3-none-any.whl
- Upload date:
- Size: 32.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
839a5ca6f838928d21f9ff55e23912045ebcbcceedf978fd75d77480395f8d9f
|
|
| MD5 |
6906acde20c999d911d572c34f149d25
|
|
| BLAKE2b-256 |
8d23b90075eb8baf12739360e1405676a42ac90e9879780366486f83118202fd
|