This repository has been archived by the owner on Aug 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import numpy as np | ||
|
||
from pylastests.test_common import las | ||
|
||
las = las | ||
|
||
|
||
def test_unpacking(las): | ||
packed_points = las.points_data | ||
unpacked_points = packed_points.to_unpacked() | ||
|
||
assert packed_points.point_format.dimension_names == unpacked_points.point_format.dimension_names | ||
for dim_name in unpacked_points.point_format.dimension_names: | ||
assert np.allclose(packed_points[dim_name], unpacked_points[dim_name]) | ||
|
||
|
||
def test_packing(las): | ||
packed_points = las.points_data | ||
unpacked_points = packed_points.to_unpacked() | ||
repacked_points = unpacked_points.to_packed() | ||
|
||
assert packed_points.point_format.dimension_names == repacked_points.point_format.dimension_names | ||
for dim_name in repacked_points.point_format.dimension_names: | ||
assert np.allclose(packed_points[dim_name], repacked_points[dim_name]) |