Skip to content

Commit

Permalink
update test data readme for las files
Browse files Browse the repository at this point in the history
  • Loading branch information
isaaccorley committed Dec 1, 2021
1 parent 4add792 commit 9c922de
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/data/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,28 @@ masks = np.random.randint(low=0, high=num_classes, size=(1, 1)).astype(np.uint8)
f.create_dataset("images", data=images)
f.create_dataset("masks", data=masks)
f.close()
```

### LAS Point Cloud files

```python
import laspy

num_points = 4

las = laspy.read("0.las")
las.points = las.points[:num_points]

points = np.random.randint(low=0, high=100, size=(num_points,), dtype=las.x.dtype)
las.x = points
las.y = points
las.z = points

if hasattr(las, "red"):
colors = np.random.randint(low=0, high=10, size=(num_points,), dtype=las.red.dtype)
las.red = colors
las.green = colors
las.blue = colors

las.write("0.las")
```

0 comments on commit 9c922de

Please sign in to comment.