From 62cac9f534adf448483c7713a7cc88e430934d3e Mon Sep 17 00:00:00 2001 From: Karamaz0V1 Date: Fri, 31 Aug 2018 10:51:38 +0200 Subject: [PATCH] Change paths management in bulk load --- raster_assistant.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/raster_assistant.py b/raster_assistant.py index 25594ec..e0edb96 100644 --- a/raster_assistant.py +++ b/raster_assistant.py @@ -69,15 +69,18 @@ def bulk_load(path, name=None, filter_treshold=.1, clip_treshold=.5, dtype=None) for a in attributes: data[a] = list() + paths = [path] if isinstance(path, str) else path + print('Load data...') - for f in find_las(path): - print('{}: '.format(f), end='') - infile = laspy.file.File(f) - for i, a in enumerate(attributes): - print('\r {}: [{:3d}%]'.format(f, int(i/len(attributes) * 100)), end='') - data[a].extend(getattr(infile, a)) - infile.close() - print('\r {}: [Done]'.format(f)) + for path in paths: + for f in find_las(path): + print('{}: '.format(f), end='') + infile = laspy.file.File(f) + for i, a in enumerate(attributes): + print('\r {}: [{:3d}%]'.format(f, int(i/len(attributes) * 100)), end='') + data[a].extend(getattr(infile, a)) + infile.close() + print('\r {}: [Done]'.format(f)) print('Create matrices...', end='')