Workaround missing num_returns in LAS headerj

This commit is contained in:
Florent Guiotte 2020-05-28 18:16:26 +02:00
parent f2c0c6e8d6
commit b00ebafd1b

View File

@ -64,6 +64,14 @@ def load_las(fname):
feature_data.append(att)
feature_dtype.append((spec.name, att.dtype))
# XXX: Workaround missing num_returns in header
try:
att = infile.num_returns
feature_data.append(att)
feature_dtype.append(('num_returns', att.dtype))
except Exception:
pass
log.debug('Create feature recarray')
feature = np.core.records.fromarrays(feature_data, dtype=feature_dtype)
del feature_data, feature_dtype