[GRASS-SVN] r52457 - grass-addons/grass6/vector/v.random.cover
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Jul 26 21:50:37 PDT 2012
Author: hamish
Date: 2012-07-26 21:50:36 -0700 (Thu, 26 Jul 2012)
New Revision: 52457
Modified:
grass-addons/grass6/vector/v.random.cover/v.random.cover
Log:
catch the case where v.report fails
Modified: grass-addons/grass6/vector/v.random.cover/v.random.cover
===================================================================
--- grass-addons/grass6/vector/v.random.cover/v.random.cover 2012-07-27 01:17:23 UTC (rev 52456)
+++ grass-addons/grass6/vector/v.random.cover/v.random.cover 2012-07-27 04:50:36 UTC (rev 52457)
@@ -114,9 +114,9 @@
# what to do in case of user break:
exitprocedure()
{
- echo 'User break!' 1>&2
- cleanup
- exit 1
+ echo 'User break!' 1>&2
+ cleanup
+ exit 1
}
# shell check for user break (signal list: trap -l)
trap "exitprocedure" 2 3 15
@@ -153,8 +153,15 @@
# proportion of in-area to region area
NS_EXT=`g.region -em | grep north | cut -f2 -d':' | awk '{print $1}'`
EW_EXT=`g.region -em | grep east | cut -f2 -d':' | awk '{print $1}'`
-REGION_AREA=`echo $NS_EXT $EW_EXT | awk '{print $1 * $2}'`
+REGION_AREA=`echo "$NS_EXT" "$EW_EXT" | awk '{print $1 * $2}'`
+
v.report map="vranda_cover_$$" option=area units=meters > "$TMP"
+if [ $? -ne 0 ] ; then
+ g.message -e "v.report failed"
+ cleanup
+ exit 1
+fi
+
AREA_COLUMN=`head -n 1 "$TMP" | tr '|' '\n' | grep -wn area | cut -f1 -d':'`
BOUND_AREA=`cut -f${AREA_COLUMN} -d'|' "$TMP" | grep -v '^area$' | tr '\n' ' '`
More information about the grass-commit
mailing list