Basic Usage
This guide covers the essential workflows for processing IGN LiDAR HD data into machine learning-ready datasets.
Overviewβ
The IGN LiDAR HD processing workflow consists of three main steps:
- Download - Get LiDAR tiles from IGN servers
- Enrich - Add building component features to points
- Process - Extract patches for machine learning
π Complete Workflow Pipelineβ
π Data Transformation Flowβ
Step 1: Download LiDAR Tilesβ
Download LiDAR tiles for your area of interest:
# Download tiles for Paris center
ign-lidar-hd download \
--bbox 2.25,48.82,2.42,48.90 \
--output /path/to/raw_tiles/ \
--max-tiles 10
Parametersβ
--bbox
: Bounding box asmin_lon,min_lat,max_lon,max_lat
--output
: Directory to save downloaded tiles--max-tiles
: Maximum number of tiles to download (optional)
Outputβ
Downloaded tiles are saved as LAZ files:
raw_tiles/
βββ LIDARHD_FXX_0123_4567_LA93_IGN69_2020.laz
βββ LIDARHD_FXX_0124_4567_LA93_IGN69_2020.laz
βββ ...
Step 2: Enrich with Building Featuresβ
Add building component classification features to the point clouds:
# Enrich tiles with building features
ign-lidar-hd enrich \
--input-dir /path/to/raw_tiles/ \
--output /path/to/enriched_tiles/ \
--mode full \
--num-workers 4
Parametersβ
--input-dir
: Directory containing raw LAZ tiles--output
: Directory to save enriched tiles--mode
: Feature extraction mode (currently onlybuilding
)--num-workers
: Number of parallel workers (optional)
Outputβ
Enriched tiles contain additional point attributes for building classification:
enriched_tiles/
βββ LIDARHD_FXX_0123_4567_LA93_IGN69_2020.laz # With building features
βββ LIDARHD_FXX_0124_4567_LA93_IGN69_2020.laz
βββ ...
Each point now has 30+ geometric features for building component classification.
Step 3: Extract Patchesβ
Extract small patches suitable for machine learning:
# Extract patches for LOD2 building classification
ign-lidar-hd process \
--input /path/to/enriched_tiles/ \
--output /path/to/patches/ \
--lod-level LOD2 \
--patch-size 10.0 \
--num-workers 4
Parametersβ
--input
: Directory containing enriched LAZ tiles--output
: Directory to save extracted patches--lod-level
: Classification level (LOD2
orLOD3
)--patch-size
: Patch size in meters (default: 10.0)--num-workers
: Number of parallel workers (optional)
Outputβ
Patches are saved as NPZ files with point clouds and labels:
patches/
βββ tile_0123_4567/
β βββ patch_0001.npz
β βββ patch_0002.npz
β βββ ...
βββ tile_0124_4567/
β βββ ...
Each patch contains:
- Point coordinates (X, Y, Z)
- Geometric features (30+ attributes)
- Building component labels
- Patch metadata
Classification Levelsβ
LOD2 (15 Classes)β
Basic building components suitable for urban analysis:
- Wall, Roof, Ground, Vegetation
- Window, Door, Balcony, Chimney
- And 7 more classes...
LOD3 (30 Classes)β
Detailed building components for architectural analysis:
- All LOD2 classes plus:
- Roof details (tiles, gutters, dormers)
- Facade elements (shutters, decorative features)
- And 15 additional detailed classes...
Complete Workflow Exampleβ
Here's a complete example processing the 13th arrondissement of Paris:
# 1. Download tiles
ign-lidar-hd download \
--bbox 2.32,48.82,2.38,48.86 \
--output data/raw_tiles/ \
--max-tiles 20
# 2. Enrich with features
ign-lidar-hd enrich \
--input-dir data/raw_tiles/ \
--output data/enriched_tiles/ \
--mode full \
--num-workers 6
# 3. Extract patches
ign-lidar-hd process \
--input data/enriched_tiles/ \
--output data/patches/ \
--lod-level LOD2 \
--patch-size 10.0 \
--num-workers 6
Expected processing time for 20 tiles:
- Download: ~15 minutes (depends on network)
- Enrich: ~45 minutes (with 6 workers)
- Process: ~30 minutes (with 6 workers)
Data Loadingβ
Once you have patches, load them for machine learning:
import numpy as np
# Load a single patch
data = np.load('patches/tile_0123_4567/patch_0001.npz')
points = data['points'] # Shape: (N, 3) - X, Y, Z
features = data['features'] # Shape: (N, 30+) - Geometric features
labels = data['labels'] # Shape: (N,) - Building component labels
print(f"Patch has {len(points)} points")
print(f"Feature dimensions: {features.shape[1]}")
print(f"Unique labels: {np.unique(labels)}")
Memory Considerationsβ
For large datasets, monitor memory usage:
# Check memory usage during processing
htop
# Reduce workers if memory is limited
ign-lidar-hd process --num-workers 2
# Process tiles one by one for very large tiles
ign-lidar-hd process --num-workers 1
See the Memory Optimization Guide for detailed memory management strategies.
Smart Skip Detectionβ
All commands automatically skip existing outputs:
# Run the same command twice - second run skips existing files
ign-lidar-hd download --bbox 2.32,48.82,2.38,48.86 --output data/raw_tiles/
# First run: Downloads new tiles
# Second run: Skips existing tiles automatically
# Force reprocessing with --force flag
ign-lidar-hd process --input data/enriched/ --output data/patches/ --force
See the Smart Skip Features guide for details.
Troubleshootingβ
Download Issuesβ
# Check network connectivity
ping geoservices.ign.fr
# Verify bbox coordinates (should be in France)
# Valid range: longitude 1-8, latitude 42-51
Processing Errorsβ
# Check file permissions
ls -la /path/to/tiles/
# Verify LAZ file integrity
lasinfo tile.laz
# Reduce workers if getting memory errors
ign-lidar-hd process --num-workers 1
Missing Featuresβ
# Verify enrichment completed successfully
lasinfo enriched_tile.laz | grep "extra bytes"
# Re-enrich if features are missing
ign-lidar-hd enrich --input-dir raw/ --output enriched/ --force
Next Stepsβ
- Advanced Processing: Learn about GPU acceleration
- QGIS Integration: See QGIS integration guide
- Batch Processing: Check out parallel processing examples
- Custom Features: Develop custom feature extractors