Fix dangerous pkill, circular import, and dedup _res_suffix
- Scope pkill to 'pdal pipeline' (avoids killing unrelated PDAL jobs) - Inline _strip_lidar_ext in dtm.py to remove circular import from pipeline - _res_suffix_str now delegates to LidarArchaeoPipeline._res_suffix
This commit is contained in:
@ -31,6 +31,15 @@ IGN_CLASS_NAMES = {
|
||||
}
|
||||
|
||||
|
||||
def _strip_lidar_ext(path):
|
||||
"""Extract base name from a LAZ/LAS file (mirrors pipeline._file_basename)."""
|
||||
name = Path(path).name
|
||||
for ext in ('.copc.laz', '.copc.las', '.laz', '.las'):
|
||||
if name.lower().endswith(ext):
|
||||
return name[:-len(ext)]
|
||||
return Path(path).stem
|
||||
|
||||
|
||||
def parse_ign_classes(spec):
|
||||
"""Convertit une liste de classes IGN (noms ou codes) en codes LAS triés.
|
||||
|
||||
@ -462,9 +471,7 @@ def classify_ground(laz_file, temp_dir, method='auto', force=False, ign_classes=
|
||||
ign_codes = parse_ign_classes(ign_classes) if method == 'ign' else None
|
||||
method_label = ign_method_label(ign_codes) if ign_codes else method
|
||||
|
||||
# Use shared basename extraction function
|
||||
from .pipeline import _file_basename
|
||||
laz_base = _file_basename(laz_file)
|
||||
laz_base = _strip_lidar_ext(laz_file)
|
||||
|
||||
output_las = temp_dir / f"{laz_base}_ground_{method_label}.las"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user