IGN LiDAR HD Dataset Processing Library for Building LOD Classification
Project description
๐บ Video Demo
โถ๏ธ Watch the Demo Video - Learn how to process LiDAR data for machine learning applications
๐ Project Overview
This library transforms raw IGN LiDAR HD point clouds into structured datasets ready for machine learning applications. Built specifically for building classification tasks, it handles the complete pipeline from data acquisition to training-ready patches.
๐ Processing Workflow
flowchart TD
A[IGN LiDAR HD Data] --> B[Download Tiles]
B --> C[Enrich with Features]
C --> D[Create Training Patches]
D --> E[ML-Ready Dataset]
B --> B1[Smart Skip Detection]
C --> C1[GPU/CPU Processing]
C --> C2[Geometric Features]
D --> D1[Data Augmentation]
D --> D2[LOD Classification]
style A fill:#e1f5fe
style E fill:#e8f5e8
style B1 fill:#fff3e0
style C1 fill:#fff3e0
style D1 fill:#fff3e0
๐ Project Stats:
- ๐๏ธ 14 core modules - Comprehensive processing toolkit
- ๐ 10 example scripts - From basic usage to advanced workflows
- ๐งช Comprehensive test suite - Ensuring reliability and performance
- ๐ 50+ curated tiles - Covering diverse French territories
- โก GPU & CPU support - Flexible computation backends
- ๐ Smart resumability - Never reprocess existing data
๐ Quick Start
Installation
pip install ign-lidar-hd
Basic Usage
from ign_lidar import LiDARProcessor
# Initialize processor
processor = LiDARProcessor(lod_level="LOD2")
# Process a single tile
patches = processor.process_tile("data.laz", "output/")
# Process multiple files
patches = processor.process_directory("data/", "output/", num_workers=4)
Command Line Interface
# Download tiles
ign-lidar-process download --bbox -2.0,47.0,-1.0,48.0 --output tiles/ --max-tiles 10
# Enrich LAZ files with geometric features
ign-lidar-process enrich --input-dir tiles/ --output enriched/ --num-workers 4
# Enrich with GPU acceleration
ign-lidar-process enrich --input-dir tiles/ --output enriched/ --use-gpu
# Create training patches
ign-lidar-process process --input-dir enriched/ --output patches/ --lod-level LOD2
# Full pipeline example
ign-lidar-process download --bbox -2.0,47.0,-1.0,48.0 --output tiles/
ign-lidar-process enrich --input-dir tiles/ --output enriched/ --num-workers 4
ign-lidar-process process --input-dir enriched/ --output patches/ --lod-level LOD2
๐ Key Features
๐๏ธ Core Processing Capabilities
- LiDAR-only processing: Pure geometric analysis without RGB dependencies
- Multi-level classification: Support for LOD2 (15 classes) and LOD3 (30+ classes)
- Rich feature extraction: Surface normals, curvature, planarity, verticality, local density
- Architectural style inference: Automatic building style classification
- Patch-based processing: Configurable 150m ร 150m patches with overlap control
โก Performance & Optimization
- GPU acceleration: CUDA-enabled feature computation for faster processing
- Parallel processing: Multi-worker support with automatic CPU core detection
- Memory optimization: Chunked processing for large datasets
- Smart skip detection: โญ๏ธ Automatically skip existing files and resume interrupted workflows
- Batch operations: Process hundreds of tiles efficiently
๐ง Workflow Automation
- Integrated downloader: IGN WFS tile discovery and batch downloading
- Format flexibility: Choose between LAZ 1.4 (full features) or QGIS-compatible output
- Data augmentation: Rotation, jitter, scaling, and dropout for ML training
- Unified CLI: Single
ign-lidar-processcommand with intuitive subcommands - Idempotent operations: Safe to restart - never reprocesses existing data
๐ Geographic Intelligence
- Strategic locations: Pre-configured urban, coastal, and rural area processing
- Bounding box filtering: Spatial subsetting for targeted analysis
- Coordinate system handling: Automatic Lambert93 to WGS84 transformations
- Tile management: Curated collection of 50+ test tiles across France
๐๏ธ Library Architecture
๐ฏ Component Architecture
graph TB
subgraph "Core Processing"
P[processor.py<br/>๐ง Main Engine]
F[features.py<br/>โก Feature Extraction]
GPU[features_gpu.py<br/>๐ฅ๏ธ GPU Acceleration]
end
subgraph "Data Management"
D[downloader.py<br/>๐ฅ IGN WFS Integration]
TL[tile_list.py<br/>๐ Tile Management]
SL[strategic_locations.py<br/>๏ฟฝ๏ธ Geographic Zones]
MD[metadata.py<br/>๐ Dataset Metadata]
end
subgraph "Classification & Styles"
C[classes.py<br/>๐ข LOD2/LOD3 Schemas]
AS[architectural_styles.py<br/>๐จ Style Inference]
end
subgraph "Integration & Config"
CLI[cli.py<br/>๐ฑ๏ธ Command Interface]
CFG[config.py<br/>โ๏ธ Configuration]
QGIS[qgis_converter.py<br/>๐ QGIS Compatibility]
U[utils.py<br/>๐ ๏ธ Core Utilities]
end
CLI --> P
CLI --> D
P --> F
P --> GPU
P --> C
F --> AS
D --> TL
D --> SL
P --> MD
style P fill:#e3f2fd
style F fill:#e8f5e8
style D fill:#fff3e0
style CLI fill:#f3e5f5
๐ Module Responsibilities
| Module | Purpose | Key Features |
|---|---|---|
๐ง processor.py |
Main processing engine | Patch creation, LOD classification, workflow orchestration |
๐ฅ downloader.py |
IGN WFS integration | Tile discovery, batch download, smart skip detection |
โก features.py |
Feature extraction | Normals, curvature, geometric properties |
๏ฟฝ๏ธ features_gpu.py |
GPU acceleration | CUDA-optimized feature computation |
๐ข classes.py |
Classification schemas | LOD2/LOD3 building taxonomies |
๐จ architectural_styles.py |
Style inference | Building architecture classification |
๐ Example Workflows
examples/
โโโ ๐ basic_usage.py # Getting started
โโโ ๐๏ธ example_urban_simple.py # Urban processing
โโโ โก parallel_processing_example.py # Performance
โโโ ๐ full_workflow_example.py # End-to-end pipeline
โโโ ๐จ multistyle_processing.py # Architecture analysis
โโโ ๐ง pytorch_dataloader.py # ML integration
โโโ workflows/ # Production pipelines
โ๏ธ CLI Commands
The package provides a unified ign-lidar-process command with three subcommands:
๐ CLI Workflow Chain
sequenceDiagram
participant User
participant CLI as ign-lidar-process
participant D as Downloader
participant E as Enricher
participant P as Processor
User->>CLI: download --bbox ...
CLI->>D: Initialize downloader
D->>D: Fetch available tiles
D->>D: Smart skip check
D-->>CLI: Downloaded tiles
CLI-->>User: โ Tiles ready
User->>CLI: enrich --input-dir ...
CLI->>E: Initialize enricher
E->>E: Compute geometric features
E->>E: GPU/CPU processing
E-->>CLI: Enriched LAZ files
CLI-->>User: โ Features computed
User->>CLI: process --input-dir ...
CLI->>P: Initialize processor
P->>P: Create training patches
P->>P: Apply augmentations
P-->>CLI: ML-ready dataset
CLI-->>User: โ Dataset ready
Download Command
Download LiDAR tiles from IGN:
ign-lidar-process download \
--bbox lon_min,lat_min,lon_max,lat_max \
--output tiles/ \
--max-tiles 50
Enrich Command
Enrich LAZ files with geometric features:
# CPU version (automatically skips existing enriched files)
ign-lidar-process enrich \
--input-dir tiles/ \
--output enriched/ \
--num-workers 4 \
--k-neighbors 10
# Force re-enrichment (ignore existing files)
ign-lidar-process enrich \
--input-dir tiles/ \
--output enriched/ \
--force
# GPU version (requires CUDA)
ign-lidar-process enrich \
--input-dir tiles/ \
--output enriched/ \
--use-gpu
๐ก Smart Skip: By default, the enrich command skips files that have already been enriched, making it safe to resume interrupted operations.
Process Command
Create training patches from enriched LAZ files:
# Automatically skips tiles with existing patches
ign-lidar-process process \
--input-dir enriched/ \
--output patches/ \
--lod-level LOD2 \
--patch-size 150.0 \
--num-workers 4 \
--num-augmentations 3
# Force reprocessing (ignore existing patches)
ign-lidar-process process \
--input-dir enriched/ \
--output patches/ \
--force
๐ก Smart Skip: The process command automatically detects existing patches and skips reprocessing, allowing you to resume interrupted batch jobs.
๐ง Configuration
LOD Levels
- LOD2: Simplified building models (15 classes)
- LOD3: Detailed building models (30 classes)
Processing Options
processor = LiDARProcessor(
lod_level="LOD2", # LOD2 or LOD3
augment=True, # Enable augmentation
num_augmentations=3, # Augmentations per patch
patch_size=150.0, # Patch size in meters
patch_overlap=0.1, # 10% overlap
bbox=[xmin, ymin, xmax, ymax] # Spatial filter
)
๐ Output Format
๐ Data Structure Overview
graph TB
subgraph "Raw Input"
LAZ[LAZ Point Cloud<br/>XYZ + Intensity<br/>Classification]
end
subgraph "Enriched Data"
ELAZ[Enhanced LAZ<br/>+ 30 Features<br/>+ Building Labels]
end
subgraph "ML Dataset"
NPZ[NPZ Patches<br/>16K points each<br/>Ready for Training]
end
subgraph "NPZ Contents"
COORD[Coordinates<br/>X, Y, Z]
GEOM[Geometric Features<br/>Normals, Curvature]
SEMANTIC[Semantic Features<br/>Planarity, Verticality]
META[Metadata<br/>Intensity, Return#]
LABELS[Building Labels<br/>LOD2/LOD3 Classes]
end
LAZ --> ELAZ
ELAZ --> NPZ
NPZ --> COORD
NPZ --> GEOM
NPZ --> SEMANTIC
NPZ --> META
NPZ --> LABELS
style LAZ fill:#ffebee
style ELAZ fill:#e3f2fd
style NPZ fill:#e8f5e8
๐ข NPZ File Structure
Each patch is saved as an NPZ file containing:
{
'points': np.ndarray, # [N, 3] XYZ coordinates
'normals': np.ndarray, # [N, 3] surface normals
'curvature': np.ndarray, # [N] principal curvature
'intensity': np.ndarray, # [N] normalized intensity
'return_number': np.ndarray, # [N] return number
'height': np.ndarray, # [N] height above ground
'planarity': np.ndarray, # [N] planarity measure
'verticality': np.ndarray, # [N] verticality measure
'horizontality': np.ndarray, # [N] horizontality measure
'density': np.ndarray, # [N] local point density
'labels': np.ndarray, # [N] building class labels
}
๐ Data Dimensions
| Component | Shape | Data Type | Description |
|---|---|---|---|
points |
[N, 3] | float32 |
3D coordinates (X, Y, Z) |
normals |
[N, 3] | float32 |
Surface normal vectors |
features |
[N, 27] | float32 |
Geometric feature matrix |
labels |
[N] | uint8 |
Building component classes |
metadata |
[4] | object |
Patch info (bbox, tile_id) |
๐ฆ Typical patch: 16,384 points, ~2.5MB compressed, ~8MB in memory
๐ Batch Download
from ign_lidar import IGNLiDARDownloader
# Initialize downloader
downloader = IGNLiDARDownloader("downloads/")
# Download tiles by bounding box (WGS84)
tiles = downloader.download_by_bbox(
bbox=(-2.0, 47.0, -1.0, 48.0), # West France
max_tiles=10
)
# Download specific tiles
tile_names = ["LHD_FXX_0186_6834_PTS_C_LAMB93_IGN69"]
downloader.download_tiles(tile_names)
๐ Examples
Urban Processing
# High-detail urban processing
processor = LiDARProcessor(lod_level="LOD3", num_augmentations=5)
patches = processor.process_tile("urban_area.laz", "output/urban/")
Rural Processing
# Simplified rural processing
processor = LiDARProcessor(lod_level="LOD2", num_augmentations=2)
patches = processor.process_tile("rural_area.laz", "output/rural/")
Batch Processing
from ign_lidar import WORKING_TILES, get_tiles_by_environment
# Get coastal tiles
coastal_tiles = get_tiles_by_environment("coastal")
# Process all coastal areas
for tile_info in coastal_tiles:
patches = processor.process_tile(
f"data/{tile_info['tile_name']}.laz",
f"output/coastal/{tile_info['tile_name']}/"
)
๐ ๏ธ Development
Setup Development Environment
git clone https://github.com/your-username/ign-lidar-hd-downloader
cd ign-lidar-hd-downloader
pip install -e ".[dev]"
Run Tests
pytest tests/
Code Formatting
black ign_lidar/
flake8 ign_lidar/
๐ Documentation & Resources
๐ Complete Documentation Hub
For comprehensive documentation, see the Documentation Hub:
- ๐ User Guides - Quick start guides, QGIS integration, troubleshooting
- โก Features - Smart skip detection, format preferences, workflow optimization
- ๐ง Technical Reference - Memory optimization, performance tuning
- ๐ฆ Archive - Bug fixes history, release notes, migration guides
๐ Essential Quick Links
- ๐ฏ Quick Reference Card - Fast reference for all commands
- โก Smart Skip Features - Resume workflows efficiently
- ๐บ๏ธ QGIS Integration - GIS compatibility guide
- โ๏ธ Memory Optimization - Performance tuning
- ๐ Output Formats - LAZ 1.4 vs QGIS formats
๐ก Examples & Workflows
- Basic Usage - Simple processing examples
- Urban Processing - City-specific workflows
- Parallel Processing - Multi-worker optimization
- Full Workflow - End-to-end pipeline
- PyTorch Integration - ML training setup
๐ Coming Soon: Interactive Documentation
We're working on a comprehensive Docusaurus documentation site that will include:
- ๐ Multi-language support (English & French)
- ๐ Full-text search
- ๐ฑ Mobile-responsive design
- ๐ Interactive tutorials
- ๐ Auto-generated API reference
- ๐ก Live code examples
See the Docusaurus Plan for details.
๐ API Reference
Core Classes
LiDARProcessor: Main processing engineIGNLiDARDownloader: Batch download functionalityLOD2_CLASSES,LOD3_CLASSES: Classification taxonomies
Utility Functions
compute_normals(): Surface normal computationcompute_curvature(): Principal curvature calculationextract_geometric_features(): Comprehensive feature extractionget_tiles_by_environment(): Filter tiles by environment type
๐ Requirements
- Python 3.8+
- NumPy >= 1.21.0
- laspy >= 2.3.0
- scikit-learn >= 1.0.0
- tqdm >= 4.60.0
- requests >= 2.25.0
๐ License
MIT License - see LICENSE file for details.
๐ค Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
๐ง Support
For issues and questions, please use the GitHub Issues page.
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 ign_lidar_hd-1.1.0.tar.gz.
File metadata
- Download URL: ign_lidar_hd-1.1.0.tar.gz
- Upload date:
- Size: 80.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c8aff44f07804a9c27ebc16c62cb534d5808ddadd4e3fc75f70eaf8d6b70b2e
|
|
| MD5 |
1adc62395a6c59c25069178bd9c29aec
|
|
| BLAKE2b-256 |
3b24335ebe5c9d9f936574126e8cc789a812da3cfbe3e4235d8f37282c929420
|
File details
Details for the file ign_lidar_hd-1.1.0-py3-none-any.whl.
File metadata
- Download URL: ign_lidar_hd-1.1.0-py3-none-any.whl
- Upload date:
- Size: 68.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
850b12bc577ce8319a9a8f265883932a3a097badf24544a42d70a71189ea40a7
|
|
| MD5 |
c8d24f440bf020900db337e774f9e5f7
|
|
| BLAKE2b-256 |
231f93230e8c23e4c9590e0416378f043d38f3656812e0da3c3c280b628fb4bf
|