[GRASS-SVN] r74166 - grass-addons/grass7/raster/r.viewshed.cva
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Mar 6 08:59:15 PST 2019
Author: neteler
Date: 2019-03-06 08:59:15 -0800 (Wed, 06 Mar 2019)
New Revision: 74166
Modified:
grass-addons/grass7/raster/r.viewshed.cva/r.viewshed.cva.py
Log:
r.viewshed.cva addon: check if input vector map exists; more keywords added
Modified: grass-addons/grass7/raster/r.viewshed.cva/r.viewshed.cva.py
===================================================================
--- grass-addons/grass7/raster/r.viewshed.cva/r.viewshed.cva.py 2019-03-06 14:14:14 UTC (rev 74165)
+++ grass-addons/grass7/raster/r.viewshed.cva/r.viewshed.cva.py 2019-03-06 16:59:15 UTC (rev 74166)
@@ -19,6 +19,8 @@
#% description: Undertakes a "cumulative viewshed analysis" using a vector points map as input "viewing" locations, using r.viewshed to calculate the individual viewsheds.
#% keyword: raster
#% keyword: viewshed
+#% keyword: line of sight
+#% keyword: LOS
#%end
#%option G_OPT_R_INPUT
@@ -135,6 +137,12 @@
flagstring += 'b'
if flags['e']:
flagstring += 'e'
+
+ # check if vector map exists
+ gfile = grass.find_file(vect, element='vector')
+ if not gfile['name']:
+ grass.fatal(_("Vector map <%s> not found") % vect)
+
# get the coords from the vector map, and check if we want to name them
if flags['k'] and options["name_column"] is not '':
# note that the "r" flag will constrain to points in the current geographic region.
More information about the grass-commit
mailing list