[GRASS-SVN] r59391 - in grass/branches/develbranch_6/scripts: d.out.file d.out.gpsdrive d.rast.edit i.spectral m.proj r.fillnulls r.in.aster r.in.srtm r.plane r.reclass.area r.shaded.relief r.tileset v.in.garmin v.in.gpsbabel
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Mar 27 02:00:27 PDT 2014
Author: hamish
Date: 2014-03-27 02:00:26 -0700 (Thu, 27 Mar 2014)
New Revision: 59391
Modified:
grass/branches/develbranch_6/scripts/d.out.file/d.out.file
grass/branches/develbranch_6/scripts/d.out.gpsdrive/d.out.gpsdrive
grass/branches/develbranch_6/scripts/d.rast.edit/d.rast.edit.tcl
grass/branches/develbranch_6/scripts/i.spectral/i.spectral
grass/branches/develbranch_6/scripts/m.proj/m.proj
grass/branches/develbranch_6/scripts/r.fillnulls/r.fillnulls
grass/branches/develbranch_6/scripts/r.in.aster/r.in.aster
grass/branches/develbranch_6/scripts/r.in.srtm/r.in.srtm
grass/branches/develbranch_6/scripts/r.plane/r.plane
grass/branches/develbranch_6/scripts/r.reclass.area/r.reclass.area
grass/branches/develbranch_6/scripts/r.shaded.relief/r.shaded.relief
grass/branches/develbranch_6/scripts/r.tileset/r.tileset
grass/branches/develbranch_6/scripts/v.in.garmin/v.in.garmin
grass/branches/develbranch_6/scripts/v.in.gpsbabel/v.in.gpsbabel
Log:
only read region, don't alter WIND file (#2230)
Modified: grass/branches/develbranch_6/scripts/d.out.file/d.out.file
===================================================================
--- grass/branches/develbranch_6/scripts/d.out.file/d.out.file 2014-03-27 08:45:31 UTC (rev 59390)
+++ grass/branches/develbranch_6/scripts/d.out.file/d.out.file 2014-03-27 09:00:26 UTC (rev 59391)
@@ -369,7 +369,7 @@
if [ $GIS_FLAG_M -eq 0 ] ; then
# chop off out of region borders
- eval `g.region -g`
+ eval `g.region -gu`
BOX_L=`echo $BOX | cut -f1 -d' '`
BOX_R=`echo $BOX | cut -f2 -d' '`
Modified: grass/branches/develbranch_6/scripts/d.out.gpsdrive/d.out.gpsdrive
===================================================================
--- grass/branches/develbranch_6/scripts/d.out.gpsdrive/d.out.gpsdrive 2014-03-27 08:45:31 UTC (rev 59390)
+++ grass/branches/develbranch_6/scripts/d.out.gpsdrive/d.out.gpsdrive 2014-03-27 09:00:26 UTC (rev 59391)
@@ -117,7 +117,7 @@
# GpsDrive scales maps named top_* as lat/lon (1:1) on-screen
# GpsDrive scales maps named map_* as UTM-like (1:cos(lat) ) on-screen
-PROJ=`g.region -p | grep ^proj | cut -f2 -d' '`
+PROJ=`g.region -pu | grep ^proj | cut -f2 -d' '`
if [ "$PROJ" -eq 3 ] ; then
IS_LATLON=1
TYPE="top"
@@ -132,7 +132,7 @@
"Keeping the area small will lessen the error, but not eliminate it. "\
"Consider output from a Lat/Lon location if the convergence angle is "\
"more than a couple of degrees."
- g.region -n
+ g.region -nu
# TODO: add a flag to correct for convergence angle with pnmrotate
fi
@@ -193,21 +193,21 @@
output="$out_jpeg"
fi
-eval `g.region -g`
+eval `g.region -gu`
FRAME_WIDTH="`echo $FRAME_DIMS | awk '{printf("%f", $2 - $1)}'`"
FRAME_HEIGHT="`echo $FRAME_DIMS | awk '{printf("%f", $4 - $3)}'`"
if [ $IS_LATLON -eq 0 ] ; then
- LAT=`g.region -lg | grep 'center_lat' | cut -f2 -d'='`
- LON=`g.region -lg | grep 'center_long' | cut -f2 -d'='`
+ LAT=`g.region -lgu | grep 'center_lat' | cut -f2 -d'='`
+ LON=`g.region -lgu | grep 'center_long' | cut -f2 -d'='`
M_PER_PIXEL=`echo $e $w $FRAME_WIDTH | awk '{printf("%f", ($1 - $2) / $3)}'`
else
- LAT=`g.region -cg | grep 'northing' | cut -f2 -d'='`
- LON=`g.region -cg | grep 'easting' | cut -f2 -d'='`
+ LAT=`g.region -cgu | grep 'northing' | cut -f2 -d'='`
+ LON=`g.region -cgu | grep 'easting' | cut -f2 -d'='`
- EXTENT=`g.region -eg | grep 'ns_extent' | cut -f2 -d'='`
+ EXTENT=`g.region -egu | grep 'ns_extent' | cut -f2 -d'='`
M_PER_PIXEL=`echo $EXTENT $FRAME_HEIGHT | awk '{printf("%f", ($1 * 1852*60.) / $2)}'`
fi
Modified: grass/branches/develbranch_6/scripts/d.rast.edit/d.rast.edit.tcl
===================================================================
--- grass/branches/develbranch_6/scripts/d.rast.edit/d.rast.edit.tcl 2014-03-27 08:45:31 UTC (rev 59390)
+++ grass/branches/develbranch_6/scripts/d.rast.edit/d.rast.edit.tcl 2014-03-27 09:00:26 UTC (rev 59391)
@@ -127,7 +127,7 @@
exec g.region --q rast=$inmap 2>$stderr
exec r.out.ppm --q $inmap out=$tempfile 2>$stderr
- set reg [exec g.region --q -g 2>$stderr]
+ set reg [exec g.region --q -gu 2>$stderr]
set reg [regsub -all {[\r\n]+} $reg { }]
set reg [regsub -all {=} $reg { }]
array set total $reg
Modified: grass/branches/develbranch_6/scripts/i.spectral/i.spectral
===================================================================
--- grass/branches/develbranch_6/scripts/i.spectral/i.spectral 2014-03-27 08:45:31 UTC (rev 59390)
+++ grass/branches/develbranch_6/scripts/i.spectral/i.spectral 2014-03-27 09:00:26 UTC (rev 59391)
@@ -282,7 +282,7 @@
# check if we are in a lat/long location
-if [ `g.region -p | grep -w '^projection' | cut -f2 -d' '` = "3" ] ; then
+if [ `g.region -pu | grep -w '^projection' | cut -f2 -d' '` = "3" ] ; then
LL=true
else
LL=false
Modified: grass/branches/develbranch_6/scripts/m.proj/m.proj
===================================================================
--- grass/branches/develbranch_6/scripts/m.proj/m.proj 2014-03-27 08:45:31 UTC (rev 59390)
+++ grass/branches/develbranch_6/scripts/m.proj/m.proj 2014-03-27 09:00:26 UTC (rev 59391)
@@ -174,7 +174,7 @@
fi
#### setup projection params
-PROJ_TYPE=`g.region -p | grep '^proj' | cut -f2 -d" "`
+PROJ_TYPE=`g.region -pu | grep '^proj' | cut -f2 -d" "`
if [ $PROJ_TYPE -eq 0 ] && ( [ $GIS_FLAG_I -eq 1 ] || [ $GIS_FLAG_O -eq 1 ] ) ; then
g.message -e "Cannot project to or from a XY location."
exit 1
Modified: grass/branches/develbranch_6/scripts/r.fillnulls/r.fillnulls
===================================================================
--- grass/branches/develbranch_6/scripts/r.fillnulls/r.fillnulls 2014-03-27 08:45:31 UTC (rev 59390)
+++ grass/branches/develbranch_6/scripts/r.fillnulls/r.fillnulls 2014-03-27 09:00:26 UTC (rev 59391)
@@ -161,7 +161,7 @@
# With just a single row of cells around the hole you often get gaps
# around the edges when distance > mean (.5 of the time? diagonals? worse
# when ewres!=nsres).
-eval `g.region -gm | grep res`
+eval `g.region -gmu | grep res`
# check-me: quoting ok?
RES="`echo $nsres $ewres | awk '{printf "%f", ($1+$2) * 3. / 2.}'`" # avg*3
@@ -276,7 +276,7 @@
g.rename "$USERMASK",MASK --quiet
fi
- eval `g.region -g`
+ eval `g.region -gu`
SIE=`echo "$ewres" | awk '{printf "%f", $1 * 3.}'`
SIN=`echo "$nsres" | awk '{printf "%f", $1 * 3.}'`
Modified: grass/branches/develbranch_6/scripts/r.in.aster/r.in.aster
===================================================================
--- grass/branches/develbranch_6/scripts/r.in.aster/r.in.aster 2014-03-27 08:45:31 UTC (rev 59390)
+++ grass/branches/develbranch_6/scripts/r.in.aster/r.in.aster 2014-03-27 09:00:26 UTC (rev 59391)
@@ -72,7 +72,7 @@
fi
# It's impossible to reproject from an arbitrary XY location
-proj_code=`g.region -p | grep '^projection:' | cut -f2 -d' '`
+proj_code=`g.region -pu | grep '^projection:' | cut -f2 -d' '`
if [ "$proj_code" -eq 0 ] ; then
g.message -e "This module needs to be run in a projected location"
exit 1
Modified: grass/branches/develbranch_6/scripts/r.in.srtm/r.in.srtm
===================================================================
--- grass/branches/develbranch_6/scripts/r.in.srtm/r.in.srtm 2014-03-27 08:45:31 UTC (rev 59390)
+++ grass/branches/develbranch_6/scripts/r.in.srtm/r.in.srtm 2014-03-27 09:00:26 UTC (rev 59391)
@@ -103,7 +103,7 @@
export LC_NUMERIC
-PROJ_TYPE=`g.region -p | grep '^proj' | cut -f2 -d" "`
+PROJ_TYPE=`g.region -pu | grep '^proj' | cut -f2 -d" "`
if [ "$PROJ_TYPE" -ne 3 ] ; then
g.message -e "SRTM data are in Latitude/Longitude. The current\
location's projection differs. Quitting."
Modified: grass/branches/develbranch_6/scripts/r.plane/r.plane
===================================================================
--- grass/branches/develbranch_6/scripts/r.plane/r.plane 2014-03-27 08:45:31 UTC (rev 59390)
+++ grass/branches/develbranch_6/scripts/r.plane/r.plane 2014-03-27 09:00:26 UTC (rev 59391)
@@ -109,7 +109,7 @@
name="$GIS_OPT_NAME"
type="$GIS_OPT_TYPE"
-eval `g.region -g`
+eval `g.region -gu`
### test input values ###
Modified: grass/branches/develbranch_6/scripts/r.reclass.area/r.reclass.area
===================================================================
--- grass/branches/develbranch_6/scripts/r.reclass.area/r.reclass.area 2014-03-27 08:45:31 UTC (rev 59390)
+++ grass/branches/develbranch_6/scripts/r.reclass.area/r.reclass.area 2014-03-27 09:00:26 UTC (rev 59391)
@@ -79,7 +79,7 @@
infile=`echo "$GIS_OPT_INPUT" | cut -f1 -d'@'`
outfile="$GIS_OPT_OUTPUT"
-g.region -p | head -n 1 |grep 0 > /dev/null
+g.region -pu | head -n 1 |grep 0 > /dev/null
if [ $? -eq 0 ] ; then
g.message -e "xy-locations are not supported"
g.message -e "Need projected data with grids in meter"
Modified: grass/branches/develbranch_6/scripts/r.shaded.relief/r.shaded.relief
===================================================================
--- grass/branches/develbranch_6/scripts/r.shaded.relief/r.shaded.relief 2014-03-27 08:45:31 UTC (rev 59390)
+++ grass/branches/develbranch_6/scripts/r.shaded.relief/r.shaded.relief 2014-03-27 09:00:26 UTC (rev 59391)
@@ -119,8 +119,8 @@
fi
# set nsres and ewres (unneeded because functions in r.mapcalc)
-#nsres=`g.region -g | grep 'nsres=' | sed s/nsres=//`
-#ewres=`g.region -g | grep 'ewres=' | sed s/ewres=//`
+#nsres=`g.region -gu | grep 'nsres=' | sed s/nsres=//`
+#ewres=`g.region -gu | grep 'ewres=' | sed s/ewres=//`
PROG=`basename "$0"`
Modified: grass/branches/develbranch_6/scripts/r.tileset/r.tileset
===================================================================
--- grass/branches/develbranch_6/scripts/r.tileset/r.tileset 2014-03-27 08:45:31 UTC (rev 59390)
+++ grass/branches/develbranch_6/scripts/r.tileset/r.tileset 2014-03-27 09:00:26 UTC (rev 59391)
@@ -417,8 +417,8 @@
makeProjector DEST_PROJ $DEST_SCALE SOURCE_PROJ $SOURCE_SCALE DEST_TO_SOURCE
g.message "Getting destination region"
-if [ -z $GIS_OPT_REGION ] ; then
- eval `g.region -g`
+if [ -z "$GIS_OPT_REGION" ] ; then
+ eval `g.region -gu`
else
eval `g.region region=$GIS_OPT_REGION -g`
fi
Modified: grass/branches/develbranch_6/scripts/v.in.garmin/v.in.garmin
===================================================================
--- grass/branches/develbranch_6/scripts/v.in.garmin/v.in.garmin 2014-03-27 08:45:31 UTC (rev 59390)
+++ grass/branches/develbranch_6/scripts/v.in.garmin/v.in.garmin 2014-03-27 09:00:26 UTC (rev 59391)
@@ -265,7 +265,7 @@
echo "$OUT_PROJ"
)`
-PROJ_TYPE=`g.region -p | grep 'projection' | cut -f2 -d" "`
+PROJ_TYPE=`g.region -pu | grep 'projection' | cut -f2 -d" "`
if [ $PROJ_TYPE -eq 0 ] && [ $KEEP_WGS84 -ne 1 ] ; then
g.message -e "Cannot project to a XY location."
rm -f "$TEMPFILE"
Modified: grass/branches/develbranch_6/scripts/v.in.gpsbabel/v.in.gpsbabel
===================================================================
--- grass/branches/develbranch_6/scripts/v.in.gpsbabel/v.in.gpsbabel 2014-03-27 08:45:31 UTC (rev 59390)
+++ grass/branches/develbranch_6/scripts/v.in.gpsbabel/v.in.gpsbabel 2014-03-27 09:00:26 UTC (rev 59391)
@@ -233,7 +233,7 @@
echo "$OUT_PROJ"
)`
-PROJ_TYPE=`g.region -p | grep 'projection' | cut -f2 -d" "`
+PROJ_TYPE=`g.region -pu | grep 'projection' | cut -f2 -d" "`
if [ $PROJ_TYPE -eq 0 ] && [ $KEEP_WGS84 -ne 1 ] ; then
g.message -e "Cannot project to a XY location."
More information about the grass-commit
mailing list