From 2f922d4dfabb6aa512da92b4ef70c767ddb3c7dc Mon Sep 17 00:00:00 2001 From: mdupays Date: Fri, 14 Jun 2024 15:54:11 +0200 Subject: [PATCH] add test for utils pdal --- test/pointcloud/test_utils_pdal.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/pointcloud/test_utils_pdal.py diff --git a/test/pointcloud/test_utils_pdal.py b/test/pointcloud/test_utils_pdal.py new file mode 100644 index 00000000..7fb8bce8 --- /dev/null +++ b/test/pointcloud/test_utils_pdal.py @@ -0,0 +1,23 @@ +import numpy as np + +from lidro.create_virtual_point.pointcloud.utils_pdal import ( + get_bounds_from_las, + read_las_file, +) + +LAS_FILE = "./data/pointcloud/LHD_FXX_0706_6627_PTS_C_LAMB93_IGN69_TEST.las" + +# Expected : ([minx,maxx],[miny,maxy]) +BoundsExpected_FILE = ([706044.94, 706292.25], [6626159, 6626324]) + + +def test_read_las_file(): + pts = read_las_file(LAS_FILE) + assert isinstance(pts, np.ndarray) # type is array + + +def test_get_bounds_from_las(): + bounds = get_bounds_from_las(LAS_FILE) + + assert isinstance(bounds, tuple) + assert bounds == BoundsExpected_FILE