Skip to content
This repository has been archived by the owner on Aug 18, 2022. It is now read-only.

Commit

Permalink
merge_las: set the point_source_id field
Browse files Browse the repository at this point in the history
  • Loading branch information
tmontaigu committed Sep 14, 2018
1 parent 79253ef commit 61d0555
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pylas/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,12 +316,13 @@ def merge_las(*las_files):
merged_z = np.zeros(num_pts_merged, np.float64)

offset = 0
for las in las_files:
for i, las in enumerate(las_files, start=1):
slc = slice(offset, offset + len(las.points))
merged.points[slc] = las.points
merged_x[slc] = las.x
merged_y[slc] = las.y
merged_z[slc] = las.z
merged['point_source_id'][slc] = i
offset += len(las.points)

merged.x = merged_x
Expand Down

0 comments on commit 61d0555

Please sign in to comment.