Skip to content

Commit

Permalink
hotfix: add unit test using compressed laz file (#224)
Browse files Browse the repository at this point in the history
* Add compressed laz file

Changed some file names as the previous .laz files were uncompressed.

* Add lidar_medium_subset_las1pt2_utmzone13N_compressed.laz

* Fix formatting

---------

Co-authored-by: Sal Tijerina <[email protected]>
  • Loading branch information
nathanfranklin and rstijerina authored Nov 27, 2024
1 parent 3f855da commit 41fb311
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
12 changes: 10 additions & 2 deletions geoapi/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def geojson_file_fixture():
@pytest.fixture()
def lidar_las1pt2_file_path_fixture():
home = os.path.dirname(__file__)
return os.path.join(home, "fixtures/lidar_subset_las1pt2.laz")
return os.path.join(home, "fixtures/lidar_subset_las1pt2.las")


@pytest.fixture()
Expand All @@ -252,7 +252,15 @@ def lidar_las_epsg7030_file_path_fixture():
@pytest.fixture()
def lidar_las1pt4_file_path_fixture():
home = os.path.dirname(__file__)
return os.path.join(home, "fixtures/lidar_subset_las1pt4.laz")
return os.path.join(home, "fixtures/lidar_subset_las1pt4.las")


@pytest.fixture()
def lidar_medium_size_compressed_las1pt2():
home = os.path.dirname(__file__)
return os.path.join(
home, "fixtures/lidar_medium_subset_las1pt2_utmzone13N_compressed.laz"
)


@pytest.fixture(scope="function")
Expand Down
Binary file not shown.
13 changes: 13 additions & 0 deletions geoapi/tests/utils_tests/test_lidar.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,16 @@ def test_get_bounding_box_epsg7030(lidar_las_epsg7030_file_path_fixture):
" 83.56995766320439 0.0255677576841291,"
" 83.56995766320439 0.0250710215953847))"
)


@pytest.mark.worker
def test_get_bounding_box_medium_size_compressed_laz(
lidar_medium_size_compressed_las1pt2,
):
bounding_box = get_bounding_box_2d([lidar_medium_size_compressed_las1pt2])
assert (
str(bounding_box)
== "POLYGON ((-105.209138419338 39.66131144844282, -105.20095449180293 39.66131144844282, "
"-105.20095449180293 39.66928201079495, -105.209138419338 39.66928201079495,"
" -105.209138419338 39.66131144844282))"
)

0 comments on commit 41fb311

Please sign in to comment.