[GRASS-SVN] r60085 - in grass-addons/grass6: display/d.anaglyph display/d.region general/g.infer general/g.region.grow raster3d/r3.in.xyz

svn_grass at osgeo.org svn_grass at osgeo.org
Sun May 4 16:38:21 PDT 2014


Author: hamish
Date: 2014-05-04 16:38:21 -0700 (Sun, 04 May 2014)
New Revision: 60085

Modified:
   grass-addons/grass6/display/d.anaglyph/d.anaglyph
   grass-addons/grass6/display/d.region/d.region
   grass-addons/grass6/general/g.infer/spearfish.py
   grass-addons/grass6/general/g.region.grow/g.region.grow
   grass-addons/grass6/raster3d/r3.in.xyz/r3.in.xyz
Log:
only read region, don't alter WIND file (#2230); minor quoting

Modified: grass-addons/grass6/display/d.anaglyph/d.anaglyph
===================================================================
--- grass-addons/grass6/display/d.anaglyph/d.anaglyph	2014-05-04 23:31:09 UTC (rev 60084)
+++ grass-addons/grass6/display/d.anaglyph/d.anaglyph	2014-05-04 23:38:21 UTC (rev 60085)
@@ -274,7 +274,7 @@
 fi
 
 if [ -n "$GIS_OPT_VLINES" ] ; then
-   eval `g.region -g`
+   eval `g.region -gu`
    VLINES="vline=$GIS_OPT_VLINES vline_color=black vline_height=$nsres"
 else
    VLINES=""
@@ -293,7 +293,7 @@
 
 #### dynamic viewpoint height calculations
 # FIXME: figure out if it is map unit extent or number of cells which controls the flipping
-eval `g.region -ge`
+eval `g.region -geu`
 # various scales of the average map extent to use for the viewing height
 avg_extent=`echo "$ns_extent $ew_extent" | awk '{print ($1 + $2)/2.0}'`
 
@@ -385,7 +385,7 @@
    LARGER=`echo "$ew_extent $ns_extent" | awk '{if ($1 > $2) { print "ew" } else { print "ns" }}'`
    if [ "ew" = "$LARGER" ] ; then
       BUFDIST=`echo "$ew_extent $ns_extent" | awk '{print int(0.5 + ($1 - $2)/2.0)}'`
-      eval `g.region -g`
+      eval `g.region -gu`
       BUFDIST_EVEN=`echo "$BUFDIST $nsres" | awk '{print $1 + (10 * $2) - ($1 % $2)}'`
       g.region n="n+$BUFDIST_EVEN" s="s-$BUFDIST_EVEN"
    fi

Modified: grass-addons/grass6/display/d.region/d.region
===================================================================
--- grass-addons/grass6/display/d.region/d.region	2014-05-04 23:31:09 UTC (rev 60084)
+++ grass-addons/grass6/display/d.region/d.region	2014-05-04 23:38:21 UTC (rev 60085)
@@ -99,18 +99,18 @@
 #%end
 
 if test "$GISBASE" = ""; then
- echo "You must be in GRASS GIS to run this program." >&2
- exit 1
+   echo "You must be in GRASS GIS to run this program." >&2
+   exit 1
 fi   
 
 if [ "$1" != "@ARGS_PARSED@" ] ; then
-  exec g.parser "$0" "$@"
+   exec g.parser "$0" "$@"
 fi
-     
 
+
 # set defaults
-originalRegionName="d_region"$$
-g.region save=$originalRegionName
+originalRegionName="d_region$$"
+g.region save="$originalRegionName"
 
 
 
@@ -118,8 +118,8 @@
 # name:     clean
 # purpose:  clean region settings
 clean () {
-    g.region region=$originalRegionName;
-    g.remove --q region=$originalRegionName; 
+    g.region region="$originalRegionName"
+    g.remove --q region="$originalRegionName"
 }
 
 #####################
@@ -127,45 +127,45 @@
 # purpose:  displays default region
 default () {
     g.region -d
-    eval `g.region -g`
+    eval `g.region -gu`
 }
 
 #####################
 # name:     current
 # purpose:  displays default region
 current () {
-    eval `g.region -g`
+    eval `g.region -gu`
 }
 
 #####################
 # name:     raster
 # purpose:  displays raster region
 raster () {
-    g.region rast=$GIS_OPT_RAST
-    eval `g.region -g`
+    g.region rast="$GIS_OPT_RAST"
+    eval `g.region -gu`
 }
 
 #####################
 # name:     vector
 # purpose:  displays vect region
 vector () {
-    g.region vect=$GIS_OPT_VECT
-    eval `g.region -g`
+    g.region vect="$GIS_OPT_VECT"
+    eval `g.region -gu`
 }
 #####################
 # name:     rast3d
 # purpose:  displays rast3d region
 rast3d () {
-    g.region rast3d=$GIS_OPT_RAST3D
-    eval `g.region -g`
+    g.region rast3d="$GIS_OPT_RAST3D"
+    eval `g.region -gu`
 }
 
 #####################
 # name:     3dview
 # purpose:  displays    3dview region
 view3d () {
-    g.region rast3d=$GIS_OPT_3DVIEW
-    eval `g.region -g`
+    g.region rast3d="$GIS_OPT_3DVIEW"
+    eval `g.region -gu`
 }
 
 #####################
@@ -196,7 +196,7 @@
     fi
 
     g.region w=$GIS_OPT_W s=$GIS_OPT_S e=$GIS_OPT_E n=$GIS_OPT_N
-    eval `g.region -g`
+    eval `g.region -gu`
 }
 
 
@@ -223,12 +223,12 @@
 $w $s
 EOF
 
-    echo $TMP
+    echo "$TMP"
 
-    if [ $GIS_FLAG_F -eq 1 ]; then
-        cat $TMP|d.graph -m color=$GIS_OPT_COLOR
+    if [ $GIS_FLAG_F -eq 1 ] ; then
+        cat "$TMP" | d.graph -m color="$GIS_OPT_COLOR"
     else
-        d.graph -m color=$GIS_OPT_COLOR input=$TMP
+        d.graph -m color="$GIS_OPT_COLOR" input="$TMP"
     fi
 
 }

Modified: grass-addons/grass6/general/g.infer/spearfish.py
===================================================================
--- grass-addons/grass6/general/g.infer/spearfish.py	2014-05-04 23:31:09 UTC (rev 60084)
+++ grass-addons/grass6/general/g.infer/spearfish.py	2014-05-04 23:38:21 UTC (rev 60085)
@@ -172,9 +172,9 @@
  (python-call grass_run_command "g.version" "gb" )
  ;Note how the flags for g.version are provided without the leading "minus": Proper call on the GRASS shell would be "g.version -gb" or "g.version -g -b" 
  (python-call grass_message "---------------------------") 
- (python-call grass_message "   Invoking: g.region -p") 
+ (python-call grass_message "   Invoking: g.region -pu") 
  (python-call grass_message " ") 
- (python-call grass_run_command "g.region" "p" )
+ (python-call grass_run_command "g.region" "pu" )
  (python-call grass_message "---------------------------") 
  (python-call grass_message "   Invoking g.list -f type=vect") 
  (python-call grass_message " ")

Modified: grass-addons/grass6/general/g.region.grow/g.region.grow
===================================================================
--- grass-addons/grass6/general/g.region.grow/g.region.grow	2014-05-04 23:31:09 UTC (rev 60084)
+++ grass-addons/grass6/general/g.region.grow/g.region.grow	2014-05-04 23:38:21 UTC (rev 60085)
@@ -53,7 +53,7 @@
 fi
 
 if [ "$GIS_FLAG_A" -eq 1 ] ; then
-    eval `g.region -g`
+    eval `g.region -gu`
     ALIGN_FLAG="-a ewres=$ewres nsres=$nsres"
 else
     ALIGN_FLAG=""

Modified: grass-addons/grass6/raster3d/r3.in.xyz/r3.in.xyz
===================================================================
--- grass-addons/grass6/raster3d/r3.in.xyz/r3.in.xyz	2014-05-04 23:31:09 UTC (rev 60084)
+++ grass-addons/grass6/raster3d/r3.in.xyz/r3.in.xyz	2014-05-04 23:38:21 UTC (rev 60085)
@@ -236,10 +236,10 @@
 fi
 
 
-eval `g.region -3 -g`
+eval `g.region -3 -gu`
 
 if [ "$nsres" != "$nsres3" ] || [ "$ewres" != "$ewres3" ] ; then
-    g.region -3 -p | grep res
+    g.region -3 -pu | grep res
     g.message -e "The 2D and 3D region settings are different. Can not continue."
     exit 1
 fi



More information about the grass-commit mailing list