Metadata-Version: 2.4
Name: lidarlens
Version: 0.1.2
Summary: A Python package for 3D LiDAR point cloud processing, analysis, terrain modelling, and visualization.
Author: Qiusheng Wu
License: MIT
Project-URL: Homepage, https://github.com/lidarlens/pylidarlens
Project-URL: Documentation, https://github.com/lidarlens/pylidarlens#readme
Project-URL: Repository, https://github.com/lidarlens/pylidarlens
Project-URL: Issues, https://github.com/lidarlens/pylidarlens/issues
Keywords: lidar,point-cloud,las,laz,copc,geospatial,3d,terrain,dem,dtm,dsm,open3d,remote-sensing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: GIS
Classifier: Topic :: Scientific/Engineering :: Image Processing
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: open3d>=0.17.0
Requires-Dist: laspy[lazrs]>=2.4.0
Requires-Dist: numpy<2.0.0,>=1.22.0
Requires-Dist: scipy>=1.9.0
Requires-Dist: pyproj>=3.4.0
Requires-Dist: matplotlib>=3.5.0
Provides-Extra: dl
Requires-Dist: torch>=2.0.0; extra == "dl"
Requires-Dist: h5py>=3.7.0; extra == "dl"
Requires-Dist: scikit-learn>=1.1.0; extra == "dl"
Provides-Extra: cli
Requires-Dist: click>=8.0.0; extra == "cli"
Provides-Extra: all
Requires-Dist: lidarlens[cli,dl]; extra == "all"
Requires-Dist: rasterio>=1.3.0; extra == "all"
Requires-Dist: pandas>=1.5.0; extra == "all"
Dynamic: license-file

# 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 `laspy` and `open3d`).
- **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

```bash
pip install lidarlens
```

To install with CLI support:
```bash
pip install lidarlens[cli]
```

To install with Deep Learning support (coming soon):
```bash
pip install lidarlens[dl]
```

## Quick Start

### Python API

```python
import lidarlens as ll

# 1. Load a point cloud
pcd, header, vlrs, wkt = ll.read("input.laz")

# 2. Preprocess
pcd = ll.denoise(pcd, method="statistical")
pcd = ll.downsample(pcd, voxel_size=0.5)

# 3. Extract Ground
ground, non_ground, plane = ll.extract_ground(pcd)

# 4. Generate DTM
dtm, meta = ll.generate_dtm(ground, resolution=1.0)

# 5. Save results
ll.save(ground, "ground.laz", header=header, wkt=wkt)
ll.dem_to_png(dtm, meta, "dtm.png")
```

### Command Line Interface

```bash
# 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
```
