Skip to content

Conversation

@mosoriob
Copy link
Collaborator

@mosoriob mosoriob commented Aug 19, 2025

Summary

Fixes floating point exception crashes in PotreeConverter and adds a new --continue-on-error flag for robust batch processing.

Problem

PotreeConverter was crashing with Floating point exception (core dumped) when processing certain LAS/LAZ files, particularly when:

  • Scale factors in LAS headers are zero (causing division by zero)
  • Bounding box dimensions are zero
  • Invalid coordinate transformations occur

This made batch processing of large datasets unreliable - a single bad file would crash the entire process.

Solution

🔧 Floating Point Exception Prevention

  • Added validation checks for zero scale factors and size values before division operations
  • Implemented try-catch blocks around critical floating point operations
  • Enhanced error messages with detailed debugging information (coordinates, scales, offsets, file paths)

🚀 Robust Batch Processing

  • New --continue-on-error flag allows processing to continue even when individual files fail
  • Graceful error handling - failed files are logged and skipped rather than crashing the entire process
  • Maintains data integrity - only processes files that can be safely converted

Usage

# Standard behavior (fails on first error)
PotreeConverter input/ -o output/

# New robust mode (continues processing despite errors)  
PotreeConverter input/ -o output/ --continue-on-error

Testing

  • Tested with the failing file /data/ibwc06-70cm_2697614c3.laz_converted
  • Verified error detection and descriptive messages
  • Confirmed graceful skipping with --continue-on-error flag
  • Validated normal processing continues for valid files

Files Modified

  • Converter/src/main.cpp - Added command line argument and options handling
  • Converter/include/converter_utils.h - Extended Options struct
  • Converter/include/chunker_countsort_laszip.h - Updated function signature
  • Converter/src/chunker_countsort_laszip.cpp - Core validation and error handling logic

Benefits

  • 🛡️ Prevents crashes from invalid LAS files
  • 📊 Enables large-scale processing of mixed-quality datasets
  • 🔍 Better debugging with detailed error information
  • Maintains performance for valid files
  • 🎯 Backward compatible - existing workflows unchanged

Closes #3

- Add validation checks for zero scale factors and size values to prevent division by zero
- Implement try-catch blocks around critical floating point operations
- Add --continue-on-error flag to allow processing multiple files even if some fail
- Provide detailed error messages for debugging invalid LAS files
- Update function signatures to pass Options through the chunker pipeline

Fixes #3
@mosoriob mosoriob linked an issue Aug 19, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix floating point exception in PotreeConverter chunker

2 participants