-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
b9bc166
commit a5ef9cd
Showing
2 changed files
with
49 additions
and
26 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
23 changes: 23 additions & 0 deletions
23
test/scripts/test_mark_points_to_use_for_digital_models_with_new_dimension.py
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,23 @@ | ||
import tempfile | ||
|
||
import numpy as np | ||
import pdal | ||
|
||
from scripts.mark_points_to_use_for_digital_models_with_new_dimension import main | ||
|
||
|
||
def test_main(): | ||
ini_las = "test/data/4_6.las" | ||
dsm_dimension = "dsm_marker" | ||
dtm_dimension = "dtm_marker" | ||
with tempfile.NamedTemporaryFile(suffix="_mark_points_output.las") as las_output: | ||
main(ini_las, las_output.name, dsm_dimension, dtm_dimension, "", "") | ||
pipeline = pdal.Pipeline() | ||
pipeline |= pdal.Reader.las(las_output.name) | ||
assert dsm_dimension in pipeline.quickinfo["readers.las"]["dimensions"].split(", ") | ||
assert dtm_dimension in pipeline.quickinfo["readers.las"]["dimensions"].split(", ") | ||
|
||
pipeline.execute() | ||
arr = pipeline.arrays[0] | ||
assert np.any(arr[dsm_dimension] == 1) | ||
assert np.any(arr[dtm_dimension] == 1) |