Skip to content

Commit

Permalink
Viewshed: change test criteria.
Browse files Browse the repository at this point in the history
  • Loading branch information
abellgithub committed Sep 5, 2024
1 parent 238f90f commit 406daf0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions autotest/utilities/test_gdal_viewshed.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ def test_gdal_viewshed_all_options(gdal_viewshed_path, tmp_path, viewshed_input)

def test_gdal_viewshed_cumulative(gdal_viewshed_path, tmp_path, viewshed_input):

import numpy as np

viewshed_out = str(tmp_path / "test_gdal_viewshed_out.tif")

_, err = gdaltest.runexternal_out_and_err(
Expand All @@ -226,10 +228,10 @@ def test_gdal_viewshed_cumulative(gdal_viewshed_path, tmp_path, viewshed_input):
assert err is None or err == ""
ds = gdal.Open(viewshed_out)
assert ds
cs = ds.GetRasterBand(1).Checksum()
vis_count = np.count_nonzero(ds.GetRasterBand(1).ReadAsArray())
nodata = ds.GetRasterBand(1).GetNoDataValue()
ds = None
assert cs == 10985
assert vis_count == 13448
assert nodata == 0


Expand Down

0 comments on commit 406daf0

Please sign in to comment.