From 42dec2304a34d389cd92aa4c1aad5c5f4c2b216a Mon Sep 17 00:00:00 2001 From: David de Meij Date: Mon, 14 Mar 2022 17:04:11 +0100 Subject: [PATCH] Avoid error in plys_to_dsm when there are no points in cloud.ply --- s2p/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/s2p/__init__.py b/s2p/__init__.py index 891e83cf..d578a2d4 100644 --- a/s2p/__init__.py +++ b/s2p/__init__.py @@ -443,6 +443,9 @@ def plys_to_dsm(tile): # compute the point cloud x, y bounds points, _ = ply.read_3d_point_cloud_from_ply(os.path.join(tile['dir'], 'cloud.ply')) + if len(points) == 0: + return + xmin, ymin, *_ = np.min(points, axis=0) xmax, ymax, *_ = np.max(points, axis=0)