[GRASS-SVN] r30549 - in grass/trunk/scripts: d.polar i.image.mosaic
i.oif r.in.srtm r.reclass.area
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Mar 13 05:16:01 EDT 2008
Author: hamish
Date: 2008-03-13 05:16:01 -0400 (Thu, 13 Mar 2008)
New Revision: 30549
Modified:
grass/trunk/scripts/d.polar/d.polar
grass/trunk/scripts/i.image.mosaic/i.image.mosaic
grass/trunk/scripts/i.oif/i.oif
grass/trunk/scripts/i.oif/i.oifcalc
grass/trunk/scripts/r.in.srtm/r.in.srtm
grass/trunk/scripts/r.reclass.area/r.reclass.area
Log:
quote some pathnames
Modified: grass/trunk/scripts/d.polar/d.polar
===================================================================
--- grass/trunk/scripts/d.polar/d.polar 2008-03-13 08:57:26 UTC (rev 30548)
+++ grass/trunk/scripts/d.polar/d.polar 2008-03-13 09:16:01 UTC (rev 30549)
@@ -405,7 +405,7 @@
AVERAGEDIRECTIONLEGENDY=`echo "1.85 $HALFFRAME" | awk '{printf "%.1f", $1 * $2}'`
##########
-cat ${GISBASE}/etc/d.polar/ps_defs.eps > "$PSOUT"
+cat "${GISBASE}/etc/d.polar/ps_defs.eps" > "$PSOUT"
echo "
$EPSSCALE $EPSSCALE scale %% EPS-SCALE EPS-SCALE scale
Modified: grass/trunk/scripts/i.image.mosaic/i.image.mosaic
===================================================================
--- grass/trunk/scripts/i.image.mosaic/i.image.mosaic 2008-03-13 08:57:26 UTC (rev 30548)
+++ grass/trunk/scripts/i.image.mosaic/i.image.mosaic 2008-03-13 09:16:01 UTC (rev 30549)
@@ -95,20 +95,23 @@
$GIS_OPT_IMAGE2+256,\
$GIS_OPT_IMAGE1)"
#modify the color table:
- echo '% 0 1024' > $CURRLOCATION/colr/$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.mosaic
+ echo '% 0 1024' > "$CURRLOCATION/colr/$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.mosaic"
eval `g.findfile element=cell file=$GIS_OPT_IMAGE1`
mapset1="${mapset}"
- cat $GISDBASE/$LOCATION_NAME/$mapset1/colr/$GIS_OPT_IMAGE1 | grep -v '%' | tr -s ' ' '\012' >> $CURRLOCATION/colr/$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.mosaic
+ cat "$GISDBASE/$LOCATION_NAME/$mapset1/colr/$GIS_OPT_IMAGE1" | \
+ grep -v '%' | tr -s ' ' '\012' >> "$CURRLOCATION/colr/$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.mosaic"
- eval `g.findfile element=cell file=$GIS_OPT_IMAGE2`
+ eval `g.findfile element=cell file="$GIS_OPT_IMAGE2"`
mapset2="${mapset}"
- cat $GISDBASE/$LOCATION_NAME/$mapset2/colr/$GIS_OPT_IMAGE2 | grep -v '%' | tr -s ' ' '\012' | awk -F':' '{print $1+256":"$2":"$3":"$4}'>>$CURRLOCATION/colr/$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.mosaic
+ cat "$GISDBASE/$LOCATION_NAME/$mapset2/colr/$GIS_OPT_IMAGE2" | \
+ grep -v '%' | tr -s ' ' '\012' | awk -F':' '{print $1+256":"$2":"$3":"$4}'\
+ >> "$CURRLOCATION/colr/$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.mosaic"
g.message message="Ready. File $GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.mosaic created."
# write cmd history:
- r.support $GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.mosaic history="${CMDLINE}"
+ r.support "$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.mosaic" history="${CMDLINE}"
exit 0
fi
@@ -117,10 +120,12 @@
g.message "Mosaicing three images..."
r.mapcalc "$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.mosaic = eval(t1=if($GIS_OPT_IMAGE1,$GIS_OPT_IMAGE1,$GIS_OPT_IMAGE2+256), t2=if(t1 % 256,t1,$GIS_OPT_IMAGE3+512), t2)"
#modify the color table:
- echo '% 0 1024' > $CURRLOCATION/colr/$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.mosaic
- tail -256 $CURRLOCATION/colr/$GIS_OPT_IMAGE1 >> $CURRLOCATION/colr/$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.mosaic
- tail -256 $CURRLOCATION/colr/$GIS_OPT_IMAGE2 |awk -F':' '{print $1+256":"$2":"$3":"$4}'>>$CURRLOCATION/colr/$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.mosaic
- tail -256 $CURRLOCATION/colr/$GIS_OPT_IMAGE3 |awk -F':' '{print $1+512":"$2":"$3":"$4}'>>$CURRLOCATION/colr/$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.mosaic
+ echo '% 0 1024' > "$CURRLOCATION/colr/$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.mosaic"
+ tail -256 $CURRLOCATION/colr/$GIS_OPT_IMAGE1 >> "$CURRLOCATION/colr/$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.mosaic"
+ tail -256 $CURRLOCATION/colr/$GIS_OPT_IMAGE2 |awk -F':' '{print $1+256":"$2":"$3":"$4}' \
+ >> "$CURRLOCATION/colr/$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.mosaic"
+ tail -256 $CURRLOCATION/colr/$GIS_OPT_IMAGE3 |awk -F':' '{print $1+512":"$2":"$3":"$4}' \
+ >> "$CURRLOCATION/colr/$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.mosaic"
g.message message="Ready. File $GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.mosaic created."
# write cmd history:
@@ -135,12 +140,15 @@
#modify the color table:
echo '% 0 1024' > $CURRLOCATION/colr/$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.$GIS_OPT_IMAGE4.mosaic
tail -256 $CURRLOCATION/colr/$GIS_OPT_IMAGE1 >> $CURRLOCATION/colr/$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.$GIS_OPT_IMAGE4.mosaic
- tail -256 $CURRLOCATION/colr/$GIS_OPT_IMAGE2 |awk -F':' '{print $1+256":"$2":"$3":"$4}'>>$CURRLOCATION/colr/$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.$GIS_OPT_IMAGE4.mosaic
- tail -256 $CURRLOCATION/colr/$GIS_OPT_IMAGE3 |awk -F':' '{print $1+512":"$2":"$3":"$4}'>>$CURRLOCATION/colr/$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.$GIS_OPT_IMAGE4.mosaic
- tail -256 $CURRLOCATION/colr/$GIS_OPT_IMAGE4 |awk -F':' '{print $1+768":"$2":"$3":"$4}'>>$CURRLOCATION/colr/$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.$GIS_OPT_IMAGE4.mosaic
+ tail -256 $CURRLOCATION/colr/$GIS_OPT_IMAGE2 |awk -F':' '{print $1+256":"$2":"$3":"$4}' \
+ >> "$CURRLOCATION/colr/$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.$GIS_OPT_IMAGE4.mosaic"
+ tail -256 $CURRLOCATION/colr/$GIS_OPT_IMAGE3 |awk -F':' '{print $1+512":"$2":"$3":"$4}' \
+ >> "$CURRLOCATION/colr/$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.$GIS_OPT_IMAGE4.mosaic"
+ tail -256 $CURRLOCATION/colr/$GIS_OPT_IMAGE4 |awk -F':' '{print $1+768":"$2":"$3":"$4}' \
+ >> "$CURRLOCATION/colr/$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.$GIS_OPT_IMAGE4.mosaic"
g.message message="Ready. File $GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.$GIS_OPT_IMAGE4.mosaic created."
# write cmd history:
- r.support $GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.$GIS_OPT_IMAGE4.mosaic history="${CMDLINE}"
+ r.support "$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.$GIS_OPT_IMAGE4.mosaic" history="${CMDLINE}"
exit 0
fi
Modified: grass/trunk/scripts/i.oif/i.oif
===================================================================
--- grass/trunk/scripts/i.oif/i.oif 2008-03-13 08:57:26 UTC (rev 30548)
+++ grass/trunk/scripts/i.oif/i.oif 2008-03-13 09:16:01 UTC (rev 30549)
@@ -123,83 +123,83 @@
g.message "Calculating OIF for the 20 band combinations..."
g.message "Calculate OIF for combination 123"
echo "123: "> "$temp_bands"
-$GISBASE/etc/i.oif/i.oifcalc 1 2 3 > "$temp_result"
+"$GISBASE"/etc/i.oif/i.oifcalc 1 2 3 > "$temp_result"
g.message "Calculate OIF for combination 124"
echo "124: " >> "$temp_bands"
-$GISBASE/etc/i.oif/i.oifcalc 1 2 4 >> "$temp_result"
+"$GISBASE"/etc/i.oif/i.oifcalc 1 2 4 >> "$temp_result"
g.message "Calculate OIF for combination 125"
echo "125: " >> "$temp_bands"
-$GISBASE/etc/i.oif/i.oifcalc 1 2 5 >> "$temp_result"
+"$GISBASE"/etc/i.oif/i.oifcalc 1 2 5 >> "$temp_result"
g.message "Calculate OIF for combination 127"
echo "127: " >> "$temp_bands"
-$GISBASE/etc/i.oif/i.oifcalc 1 2 7 >> "$temp_result"
+"$GISBASE"/etc/i.oif/i.oifcalc 1 2 7 >> "$temp_result"
g.message "Calculate OIF for combination 134"
echo "134: " >> "$temp_bands"
-$GISBASE/etc/i.oif/i.oifcalc 1 3 4 >> "$temp_result"
+"$GISBASE"/etc/i.oif/i.oifcalc 1 3 4 >> "$temp_result"
g.message "Calculate OIF for combination 135"
echo "135: " >> "$temp_bands"
-$GISBASE/etc/i.oif/i.oifcalc 1 3 5 >> "$temp_result"
+"$GISBASE"/etc/i.oif/i.oifcalc 1 3 5 >> "$temp_result"
g.message "Calculate OIF for combination 137"
echo "137: " >> "$temp_bands"
-$GISBASE/etc/i.oif/i.oifcalc 1 3 7 >> "$temp_result"
+"$GISBASE"/etc/i.oif/i.oifcalc 1 3 7 >> "$temp_result"
g.message "Calculate OIF for combination 145"
echo "145: " >> "$temp_bands"
-$GISBASE/etc/i.oif/i.oifcalc 1 4 5 >> "$temp_result"
+"$GISBASE"/etc/i.oif/i.oifcalc 1 4 5 >> "$temp_result"
g.message "Calculate OIF for combination 147"
echo "147: " >> "$temp_bands"
-$GISBASE/etc/i.oif/i.oifcalc 1 4 7 >> "$temp_result"
+"$GISBASE"/etc/i.oif/i.oifcalc 1 4 7 >> "$temp_result"
g.message "Calculate OIF for combination 157"
echo "157: " >> "$temp_bands"
-$GISBASE/etc/i.oif/i.oifcalc 1 5 7 >> "$temp_result"
+"$GISBASE"/etc/i.oif/i.oifcalc 1 5 7 >> "$temp_result"
g.message "Calculate OIF for combination 234"
echo "234: " >> "$temp_bands"
-$GISBASE/etc/i.oif/i.oifcalc 2 3 4 >> "$temp_result"
+"$GISBASE"/etc/i.oif/i.oifcalc 2 3 4 >> "$temp_result"
g.message "Calculate OIF for combination 235"
echo "235: " >> "$temp_bands"
-$GISBASE/etc/i.oif/i.oifcalc 2 3 5 >> "$temp_result"
+"$GISBASE"/etc/i.oif/i.oifcalc 2 3 5 >> "$temp_result"
g.message "Calculate OIF for combination 237"
echo "237: " >> "$temp_bands"
-$GISBASE/etc/i.oif/i.oifcalc 2 3 7 >> "$temp_result"
+"$GISBASE"/etc/i.oif/i.oifcalc 2 3 7 >> "$temp_result"
g.message "Calculate OIF for combination 245"
echo "245: " >> "$temp_bands"
-$GISBASE/etc/i.oif/i.oifcalc 2 4 5 >> "$temp_result"
+"$GISBASE"/etc/i.oif/i.oifcalc 2 4 5 >> "$temp_result"
g.message "Calculate OIF for combination 247"
echo "247: " >> "$temp_bands"
-$GISBASE/etc/i.oif/i.oifcalc 2 4 7 >> "$temp_result"
+"$GISBASE"/etc/i.oif/i.oifcalc 2 4 7 >> "$temp_result"
g.message "Calculate OIF for combination 257"
echo "257: " >> "$temp_bands"
-$GISBASE/etc/i.oif/i.oifcalc 2 5 7 >> "$temp_result"
+"$GISBASE"/etc/i.oif/i.oifcalc 2 5 7 >> "$temp_result"
g.message "Calculate OIF for combination 345"
echo "345: " >> "$temp_bands"
-$GISBASE/etc/i.oif/i.oifcalc 3 4 5 >> "$temp_result"
+"$GISBASE"/etc/i.oif/i.oifcalc 3 4 5 >> "$temp_result"
g.message "Calculate OIF for combination 347"
echo "347: " >> "$temp_bands"
-$GISBASE/etc/i.oif/i.oifcalc 3 4 7 >> "$temp_result"
+"$GISBASE"/etc/i.oif/i.oifcalc 3 4 7 >> "$temp_result"
g.message "Calculate OIF for combination 357"
echo "357: " >> "$temp_bands"
-$GISBASE/etc/i.oif/i.oifcalc 3 5 7 >> "$temp_result"
+"$GISBASE"/etc/i.oif/i.oifcalc 3 5 7 >> "$temp_result"
g.message "Calculate OIF for combination 457"
echo "457: " >> "$temp_bands"
-$GISBASE/etc/i.oif/i.oifcalc 4 5 7 >> "$temp_result"
+"$GISBASE"/etc/i.oif/i.oifcalc 4 5 7 >> "$temp_result"
paste -d' ' "$temp_bands" "$temp_result" > "$temp_result2"
g.message "Ready."
Modified: grass/trunk/scripts/i.oif/i.oifcalc
===================================================================
--- grass/trunk/scripts/i.oif/i.oifcalc 2008-03-13 08:57:26 UTC (rev 30548)
+++ grass/trunk/scripts/i.oif/i.oifcalc 2008-03-13 09:16:01 UTC (rev 30549)
@@ -29,9 +29,9 @@
export LC_NUMERIC
# calculate SUM of Stddeviations:
-$GISBASE/etc/i.oif/m.cutmatrix "$temp_stddev" 1 $1 > "$temp_sum"
-$GISBASE/etc/i.oif/m.cutmatrix "$temp_stddev" 1 $2 >> "$temp_sum"
-$GISBASE/etc/i.oif/m.cutmatrix "$temp_stddev" 1 $3 >> "$temp_sum"
+"$GISBASE"/etc/i.oif/m.cutmatrix "$temp_stddev" 1 $1 > "$temp_sum"
+"$GISBASE"/etc/i.oif/m.cutmatrix "$temp_stddev" 1 $2 >> "$temp_sum"
+"$GISBASE"/etc/i.oif/m.cutmatrix "$temp_stddev" 1 $3 >> "$temp_sum"
cat "$temp_sum" | awk -v temp_file="$temp_calc" \
'BEGIN {sum = 0.0}
@@ -42,9 +42,9 @@
}'
# calculate SUM of absolute(Correlation values):
-$GISBASE/etc/i.oif/m.cutmatrix "$temp_correlation" $1 $2 > "$temp_sum"
-$GISBASE/etc/i.oif/m.cutmatrix "$temp_correlation" $1 $3 >> "$temp_sum"
-$GISBASE/etc/i.oif/m.cutmatrix "$temp_correlation" $2 $3 >> "$temp_sum"
+"$GISBASE"/etc/i.oif/m.cutmatrix "$temp_correlation" $1 $2 > "$temp_sum"
+"$GISBASE"/etc/i.oif/m.cutmatrix "$temp_correlation" $1 $3 >> "$temp_sum"
+"$GISBASE"/etc/i.oif/m.cutmatrix "$temp_correlation" $2 $3 >> "$temp_sum"
cat "$temp_sum" | awk -v temp_file="$temp_calc" \
'BEGIN {sum = 0.0}
Modified: grass/trunk/scripts/r.in.srtm/r.in.srtm
===================================================================
--- grass/trunk/scripts/r.in.srtm/r.in.srtm 2008-03-13 08:57:26 UTC (rev 30548)
+++ grass/trunk/scripts/r.in.srtm/r.in.srtm 2008-03-13 09:16:01 UTC (rev 30549)
@@ -242,7 +242,7 @@
fi
#create prj file: To be precise, we would need EGS96! But who really cares...
-echo "GEOGCS["wgs84",DATUM["WGS_1984",SPHEROID["wgs84",6378137,298.257223563],TOWGS84[0.000000,0.000000,0.000000]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]" > $TILE.prj
+echo "GEOGCS["wgs84",DATUM["WGS_1984",SPHEROID["wgs84",6378137,298.257223563],TOWGS84[0.000000,0.000000,0.000000]],PRIMEM["Greenwich",0],UNIT["degree",0.0174532925199433]]" > "$TILE.prj"
r.in.gdal in="$TILE.bil" out="$TILEOUT"
EXITCODE=$?
Modified: grass/trunk/scripts/r.reclass.area/r.reclass.area
===================================================================
--- grass/trunk/scripts/r.reclass.area/r.reclass.area 2008-03-13 08:57:26 UTC (rev 30548)
+++ grass/trunk/scripts/r.reclass.area/r.reclass.area 2008-03-13 09:16:01 UTC (rev 30549)
@@ -141,7 +141,7 @@
# echo
# echo "Generating a reclass rules file categorized by hectares"
# r.stats -an in=$file2,$infile |awk '{hectares=$3 * 0.0001;
-# printf("%d = %d %.4f\n",$1,hectares,hectares)}' > $infile.rules
+# printf("%d = %d %.4f\n",$1,hectares,hectares)}' > "$infile.rules"
# else
if test $op = 0; then
g.message "Generating a reclass rules file with area size less than or equal to $limit hectares"
More information about the grass-commit
mailing list