[GRASS-SVN] r62333 - grass/trunk/raster/r.viewshed/testsuite
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Oct 21 20:54:03 PDT 2014
Author: annakrat
Date: 2014-10-21 20:54:03 -0700 (Tue, 21 Oct 2014)
New Revision: 62333
Modified:
grass/trunk/raster/r.viewshed/testsuite/test_r_viewshed.py
Log:
r.viewshed: add more tests
Modified: grass/trunk/raster/r.viewshed/testsuite/test_r_viewshed.py
===================================================================
--- grass/trunk/raster/r.viewshed/testsuite/test_r_viewshed.py 2014-10-21 20:39:49 UTC (rev 62332)
+++ grass/trunk/raster/r.viewshed/testsuite/test_r_viewshed.py 2014-10-22 03:54:03 UTC (rev 62333)
@@ -28,8 +28,24 @@
coordinates=(634720,216180), output=self.viewshed,
obs_elev=obs_elev)
self.assertRasterMinMax(map=self.viewshed, refmin=0, refmax=180,
- msg="Viewing angle above the ground must be between 0 and 180 deg")
+ msg="Viewing angle above the ground must be between 0 and 180 deg")
+ def test_limits_flags(self):
+ obs_elev = '1.72'
+ # test e flag
+ self.assertModule('r.viewshed', input='elevation', flags='e',
+ coordinates=(634720, 216180), output=self.viewshed,
+ obs_elev=obs_elev)
+ minmax = 'null_cells=1963758\nmin=-24.98421\nmax=43.15356'
+ self.assertRasterFitsUnivar(raster=self.viewshed, reference=minmax, precision=1e-5)
+ # test b flag (#1788)
+ self.assertModule('r.viewshed', input='elevation', flags='b',
+ coordinates=(634720, 216180), output=self.viewshed,
+ obs_elev=obs_elev, overwrite=True)
+ minmax = 'min=0\nmax=1\ndatatype=CELL'
+ self.assertRasterFitsInfo(raster=self.viewshed, reference=minmax,
+ msg="Values of binary output must be 0 or 1")
+
def test_limits_extreme_value(self):
"""Test extremely high observer elevation
More information about the grass-commit
mailing list