@@ -42,3 +42,41 @@ def test_compare(autzen_2010_file: str, autzen_2023_file: str):
4242 values = pipeline .arrays [0 ]["m3c2_distance" ]
4343 assert values .min () == pytest .approx (- 3.227012699417537 , abs = 1e-15 )
4444 assert values .max () == pytest .approx (4.87166403256035 , abs = 1e-15 )
45+
46+
47+ @pytest .mark .skipif (pdal .info .major <= 2 and pdal .info .minor < 10 , reason = "Requires PDAL version 2.10 or higher" )
48+ def test_compare_without_sampling (autzen_2010_file : str , autzen_2023_file : str ):
49+ """Test compare function"""
50+
51+ output_path = utils .test_data_output_filepath (f"autzen-compare-no-sampling.copc.laz" , "compare" )
52+
53+ res = subprocess .run (
54+ [
55+ utils .pdal_wrench_path (),
56+ "compare" ,
57+ f"--input={ autzen_2010_file } " ,
58+ f"--input-compare={ autzen_2023_file } " ,
59+ f"--output={ output_path .as_posix ()} " ,
60+ ],
61+ check = True ,
62+ )
63+
64+ assert res .returncode == 0
65+ assert output_path .exists ()
66+
67+ pipeline = pdal .Reader (filename = output_path .as_posix ()).pipeline ()
68+ pipeline .execute ()
69+
70+ dimensions = pipeline .arrays [0 ].dtype .names
71+
72+ assert "m3c2_distance" in dimensions
73+ assert "m3c2_uncertainty" in dimensions
74+ assert "m3c2_significant" in dimensions
75+ assert "m3c2_std_dev1" in dimensions
76+ assert "m3c2_std_dev2" in dimensions
77+ assert "m3c2_count1" in dimensions
78+ assert "m3c2_count2" in dimensions
79+
80+ values = pipeline .arrays [0 ]["m3c2_distance" ]
81+ assert values .min () == pytest .approx (- 3.8898310663727376 , abs = 1e-15 )
82+ assert values .max () == pytest .approx (5.081599567261037 , abs = 1e-15 )
0 commit comments