Processor API
Complete API reference for the IGN LiDAR HD processor module.
Processor Classβ
The main processor class for handling LiDAR data processing workflows.
Constructorβ
from ign_lidar import Processor
processor = Processor(config=None, verbose=True)
Parameters:
config(Config, optional): Configuration object with processing parametersverbose(bool): Enable verbose logging output
Methodsβ
process_tile()β
Process a single LAS/LAZ tile with feature extraction.
def process_tile(self, input_path: str, output_path: str = None) -> dict:
Parameters:
input_path(str): Path to input LAS/LAZ fileoutput_path(str, optional): Path for output file
Returns:
dict: Processing results with metrics and status
Example:
result = processor.process_tile("input.las", "output_enriched.las")
print(f"Processed {result['points_count']} points")
batch_process()β
Process multiple tiles in batch mode.
def batch_process(self, tile_list: list, output_dir: str) -> list:
Parameters:
tile_list(list): List of input file pathsoutput_dir(str): Output directory for processed files
Returns:
list: List of processing results for each tile
extract_features()β
Extract geometric and radiometric features from point cloud.
def extract_features(self, points: numpy.ndarray,
feature_types: list = None) -> numpy.ndarray:
Parameters:
points(numpy.ndarray): Point cloud datafeature_types(list, optional): List of features to extract
Returns:
numpy.ndarray: Array with extracted features
Available feature types:
height_above_ground: Normalized heightintensity_normalized: Normalized intensitylocal_density: Local point densitysurface_roughness: Surface roughness measureplanarity: Planarity coefficientsphericity: Sphericity coefficient
classify_points()β
Classify points into semantic categories.
def classify_points(self, points: numpy.ndarray,
features: numpy.ndarray) -> numpy.ndarray:
Parameters:
points(numpy.ndarray): Point cloud datafeatures(numpy.ndarray): Extracted features
Returns:
numpy.ndarray: Classification labels
Configuration Optionsβ
Processing Parametersβ
from ign_lidar import Config
config = Config(
chunk_size=1000000,
overlap_size=50,
classification_model="random_forest",
feature_radius=2.0,
min_points_per_class=100
)
Performance Tuningβ
config = Config(
use_gpu=True,
max_memory_gb=16,
num_workers=8,
cache_features=True
)
Error Handlingβ
The processor handles common errors gracefully:
try:
result = processor.process_tile("input.las")
except FileNotFoundError:
print("Input file not found")
except MemoryError:
print("Insufficient memory for processing")
except ValueError as e:
print(f"Invalid parameter: {e}")
Performance Tipsβ
- Batch Processing: Process multiple tiles together for better efficiency
- Memory Management: Set appropriate chunk sizes for available RAM
- GPU Acceleration: Enable GPU processing for large datasets
- Feature Caching: Cache computed features for repeated use