From 6c9b3786431ff9d7f43ce9e5ae3aba78f11f9228 Mon Sep 17 00:00:00 2001 From: GLiegard Date: Mon, 26 Jan 2026 17:14:22 +0100 Subject: [PATCH 1/2] fix bug 2461: now we create a buffered tile in LAS instead of LAZ (no compression, no bug) --- RELEASE_NOTES.md | 2 ++ ctview/main_ctview.py | 9 ++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 2f057fa..0ef1e6b 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,4 +1,6 @@ # dev +- Fix bug 2461, due to an error on ZIP compression while making buffered tile. + The temporary buffered tile is now a LAS (instead of a LAZ), so there is no compression. - Adapt ci for github - host docker image on ghcr.io - update dependencies diff --git a/ctview/main_ctview.py b/ctview/main_ctview.py index 1586836..1b89010 100644 --- a/ctview/main_ctview.py +++ b/ctview/main_ctview.py @@ -48,12 +48,15 @@ def main_ctview(config: DictConfig): # Buffer log.info(f"\nStep 1: Create buffered las file with buffer = {config.buffer.size}") + # Use .las extension (instead of .laz) to avoid a bug with LAZ compression + buffered_las = Path(initial_las_filename).stem + ".las" if config.buffer.output_subdir: - las_with_buffer = Path(out_dir) / config.buffer.output_subdir / initial_las_filename + las_with_buffer = Path(out_dir) / config.buffer.output_subdir / buffered_las else: - las_with_buffer = Path(tmpdir_buffer) / initial_las_filename - las_with_buffer.parent.mkdir(parents=True, exist_ok=True) + las_with_buffer = Path(tmpdir_buffer) / buffered_las + las_with_buffer.parent.mkdir(parents=True, exist_ok=True) + print("las with buffer:", las_with_buffer) epsg = config.io.spatial_reference create_las_with_buffer( input_dir=str(in_dir), From f9153b6cb300bd91cc7f38d86cb3fb53f7a0fd8c Mon Sep 17 00:00:00 2001 From: GLiegard Date: Mon, 26 Jan 2026 17:53:09 +0100 Subject: [PATCH 2/2] fix test --- test/test_add_color.py | 2 +- test/test_main_ctview.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_add_color.py b/test/test_add_color.py index 8382288..65ef75a 100644 --- a/test/test_add_color.py +++ b/test/test_add_color.py @@ -105,6 +105,6 @@ def test_color_raster_with_interpolation(): # pixel with value = 5 assert np.all(data[:, 1, 2] == np.array([255, 255, 255])) # The central pixel value (4) is surrounded with [0, 0, 0] and [255, 255, 255] values - assert np.all(data[:, 1, 1] == np.array([127, 127, 127])) + assert np.all(data[:, 1, 1] == np.array([128, 128, 128])) # pixel with value = 0 (= no data, but is defined in the colormap) assert np.all(data[:, 0, 0] == np.array([1, 2, 3])) diff --git a/test/test_main_ctview.py b/test/test_main_ctview.py index 3265a6b..9133888 100644 --- a/test/test_main_ctview.py +++ b/test/test_main_ctview.py @@ -147,7 +147,7 @@ def assert_las_buffer_is_not_empty(output: str, filename: str): def test_main_modif_config(): input_dir = Path("data") / "las" / "classee" output_dir = OUTPUT_DIR / "main_modif_config" - outfile_buffer = output_dir / "tmp" / "buffer" / "test_data_77050_627755_LA93_IGN69_buildings.laz" + outfile_buffer = output_dir / "tmp" / "buffer" / "test_data_77050_627755_LA93_IGN69_buildings.las" outfile_density = output_dir / "density" / "test_data_77050_627755_LA93_IGN69_buildings_density.tif" outfile_class_raw = ( output_dir / "class" / "tmp" / "binary" / "test_data_77050_627755_LA93_IGN69_buildings_class_raw.tif"