[GRASS-SVN] r34189 - in grass/trunk/scripts: d.correlate d.polar d.rast.edit d.rast.leg d.shadedmap db.dropcol db.droptable db.in.ogr db.out.ogr db.test g.manual i.fusion.brovey i.image.mosaic i.in.spotvgt i.landsat.rgb i.oif i.spectral i.tasscap m.proj r.blend r.fillnulls r.in.aster r.in.srtm r.mask r.out.xyz r.plane r.reclass.area r.regression.line r.shaded.relief v.build.all v.centroids v.convert.all v.db.addcol v.db.addtable v.db.dropcol v.db.droptable v.db.join v.db.reconnect.all v.db.renamecol v.db.univar v.db.update v.dissolve v.in.e00 v.in.geonames v.in.gns v.in.mapgen v.in.sites.all v.in.wfs v.rast.stats v.report v.what.vect

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Nov 7 17:15:10 EST 2008


Author: glynn
Date: 2008-11-07 17:15:08 -0500 (Fri, 07 Nov 2008)
New Revision: 34189

Removed:
   grass/trunk/scripts/d.correlate/d.correlate
   grass/trunk/scripts/d.polar/d.polar
   grass/trunk/scripts/d.rast.edit/d.rast.edit
   grass/trunk/scripts/d.rast.leg/d.rast.leg
   grass/trunk/scripts/d.shadedmap/d.shadedmap
   grass/trunk/scripts/db.dropcol/db.dropcol
   grass/trunk/scripts/db.droptable/db.droptable
   grass/trunk/scripts/db.in.ogr/db.in.ogr
   grass/trunk/scripts/db.out.ogr/db.out.ogr
   grass/trunk/scripts/db.test/db.test
   grass/trunk/scripts/g.manual/g.manual
   grass/trunk/scripts/i.fusion.brovey/i.fusion.brovey
   grass/trunk/scripts/i.image.mosaic/i.image.mosaic
   grass/trunk/scripts/i.in.spotvgt/i.in.spotvgt
   grass/trunk/scripts/i.landsat.rgb/i.landsat.rgb
   grass/trunk/scripts/i.oif/i.oif
   grass/trunk/scripts/i.spectral/i.spectral
   grass/trunk/scripts/i.tasscap/i.tasscap
   grass/trunk/scripts/m.proj/m.proj
   grass/trunk/scripts/r.blend/r.blend
   grass/trunk/scripts/r.fillnulls/r.fillnulls
   grass/trunk/scripts/r.in.aster/r.in.aster
   grass/trunk/scripts/r.in.srtm/r.in.srtm
   grass/trunk/scripts/r.mask/r.mask
   grass/trunk/scripts/r.out.xyz/r.out.xyz
   grass/trunk/scripts/r.plane/r.plane
   grass/trunk/scripts/r.reclass.area/r.reclass.area
   grass/trunk/scripts/r.regression.line/r.regression.line
   grass/trunk/scripts/r.shaded.relief/r.shaded.relief
   grass/trunk/scripts/v.build.all/v.build.all
   grass/trunk/scripts/v.centroids/v.centroids
   grass/trunk/scripts/v.convert.all/v.convert.all
   grass/trunk/scripts/v.db.addcol/v.db.addcol
   grass/trunk/scripts/v.db.addtable/v.db.addtable
   grass/trunk/scripts/v.db.dropcol/v.db.dropcol
   grass/trunk/scripts/v.db.droptable/v.db.droptable
   grass/trunk/scripts/v.db.join/v.db.join
   grass/trunk/scripts/v.db.reconnect.all/v.db.reconnect.all
   grass/trunk/scripts/v.db.renamecol/v.db.renamecol
   grass/trunk/scripts/v.db.univar/v.db.univar
   grass/trunk/scripts/v.db.update/v.db.update
   grass/trunk/scripts/v.dissolve/v.dissolve
   grass/trunk/scripts/v.in.e00/v.in.e00
   grass/trunk/scripts/v.in.geonames/v.in.geonames
   grass/trunk/scripts/v.in.gns/v.in.gns
   grass/trunk/scripts/v.in.mapgen/v.in.mapgen
   grass/trunk/scripts/v.in.sites.all/v.in.sites.all
   grass/trunk/scripts/v.in.wfs/v.in.wfs
   grass/trunk/scripts/v.rast.stats/v.rast.stats
   grass/trunk/scripts/v.report/v.report
   grass/trunk/scripts/v.what.vect/v.what.vect
Log:
Remove shell versions of converted scripts


Deleted: grass/trunk/scripts/d.correlate/d.correlate
===================================================================
--- grass/trunk/scripts/d.correlate/d.correlate	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/d.correlate/d.correlate	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,162 +0,0 @@
-#!/bin/sh
-#
-############################################################################
-#
-# MODULE:       d.correlate for GRASS 6; based on dcorrelate.sh for GRASS 4,5
-# AUTHOR(S):    CERL - Michael Shapiro; updated to GRASS 6 by Markus Neteler 5/2005
-# PURPOSE:      prints a graph of the correlation between data layers (in pairs)
-#               derived from <grass5>/src.local/d.correlate.sh
-# COPYRIGHT:    (C) 2005 by the GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-# TODO GRASS 7: rename parameters to map1, map2 or better multiple map=map1[,map2[...]]
-#############################################################################
-
-#%Module
-#%  description: Prints a graph of the correlation between data layers (in pairs).
-#%  keywords: display, diagram
-#%End
-#%option
-#% key: layer1
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: raster input map
-#% required : yes
-#%end
-#%option
-#% key: layer2
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: raster input map
-#% required : yes
-#%end
-#%option
-#% key: layer3
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: raster input map
-#% required : no
-#%end
-#%option
-#% key: layer4
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: raster input map
-#% required : no
-#%end
-
-if [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." >&2
-    exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    CMDLINE="`basename $0`"
-    for arg in "$@" ; do
-        CMDLINE="$CMDLINE \"$arg\""
-    done
-    export CMDLINE
-    exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-#### check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message -e "awk required, please install awk or gawk first"
-    exit 1
-fi
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-if [ $# -gt 4 ] ; then
-        g.message -e "max 4 layers allowed"
-	exit 1
-fi
-
-TMP1="`g.tempfile pid=$$`"
-
-ok=yes
-for f in $GIS_OPT_LAYER1 $GIS_OPT_LAYER2 $GIS_OPT_LAYER3 $GIS_OPT_LAYER4
-do
-  eval `g.findfile element=cell file=$f`
-  if [ -z "$name" ] ; then
-        g.message -e "$f not found"
-	ok=no
-  fi
-done
-
-if [ "$ok" = "no" ] ; then
- exit 1
-fi
-
-d.erase
-if [ $? != 0 ] ; then
- exit 1
-fi
-
-# how many cmd line arguments?
-ARGNUM=`echo "$CMDLINE" | tr -s ' ' '\n' | wc -l | awk '{print $1 - 1}'`
-
-echo "CORRELATION" | d.text color=white size=4 line=1
-colors="red black blue green gray violet"
-if [ $ARGNUM -eq 2 ] ; then
-  line=4
-else
-  line=2
-fi
-iloop=0
-jloop=0
-
-# get max in case of two maps for x, y axis
-eval `r.univar -g $GIS_OPT_LAYER1`
-max_layer1=$max
-eval `r.univar -g $GIS_OPT_LAYER2`
-max_layer2=$max
-
-for i in $GIS_OPT_LAYER1 $GIS_OPT_LAYER2 $GIS_OPT_LAYER3 $GIS_OPT_LAYER4
-do
-   iloop=`expr $iloop + 1`
-   for j in $GIS_OPT_LAYER1 $GIS_OPT_LAYER2 $GIS_OPT_LAYER3 $GIS_OPT_LAYER4 ; do
-    jloop=`expr $jloop + 1`
-    if [ "$i" != "$j" -a $iloop -le $jloop ] ; then
-      colorstmp1=`echo $colors | cut -d' ' -f1`
-      colorstmp2=`echo $colors | cut -d' ' -f2-`
-      colors=`echo $colorstmp2 $colorstmp1`
-
-      if [ $ARGNUM -eq 2 ] ; then
-        echo $j | d.text color=`echo $colors | cut -d' ' -f1` size=4 at=0,9$line
-        echo $i | d.text color=`echo $colors | cut -d' ' -f1` size=4 at=60,0$line
-      else
-        echo $i $j | d.text color=`echo $colors | cut -d' ' -f1` size=4 line=$line
-      fi
-      line=`expr $line + 1`
-      r.stats -cnA input=$i,$j > "$TMP1"
-      m="`awk '$1>max1{max1=$1} $2>max2{max2=$2} min1==0||$1<min1{min1=$1} min2==0||$2<min2{min2=$2} END {print min1,max1,min2,max2}' $TMP1`"
-      m1=`echo $m | cut -d' ' -f1`
-      m2=`echo $m | cut -d' ' -f2`
-      m3=`echo $m | cut -d' ' -f3`
-      m4=`echo $m | cut -d' ' -f4`
-      awk '{print "move",($1-min1+1)*100.0/(max1-min1+1),($2-min2+1)*100.0/(max2-min2+1);print "draw",($1-min1+1)*100.0/(max1-min1+1),($2-min2+1)*100.0/(max2-min2+1) }' min1=$m1 max1=$m2 min2=$m3 max2=$m4 "$TMP1" | d.graph color=`echo $colors | cut -d' ' -f1`
-
-      if [ $ARGNUM -eq 2 ] ; then
-         d.graph << EOF
-size 2 2
-move 0 92
-text $max_layer1
-move 90 2
-text $max_layer2
-EOF
-      fi
-    fi
-   done
-   jloop=0
-done
-
-rm -f "$TMP1"

Deleted: grass/trunk/scripts/d.polar/d.polar
===================================================================
--- grass/trunk/scripts/d.polar/d.polar	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/d.polar/d.polar	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,554 +0,0 @@
-#!/bin/sh
-############################################################################
-#
-# MODULE:       d.polar
-# AUTHOR(S):    Markus Neteler. neteler itc.it
-#               algorithm + EPS output by Bruno Caprile
-#               d.graph plotting code by Hamish Bowman
-# PURPOSE:      Draws polar diagram of angle map. The outer circle considers
-#               all cells in the map. If one or many of them are NULL (no data),
-#               the figure will not reach the outer circle. The vector inside
-#               indicates the prevalent direction.
-# COPYRIGHT:    (C) 2006 by the GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-#############################################################################
-
-#%Module
-#%  description: Draws polar diagram of angle map such as aspect or flow directions
-#%  keywords: display, diagram
-#%End
-#%option
-#% key: map
-#% type: string
-#% key_desc: name
-#% gisprompt: old,cell,raster
-#% description: Name of raster angle map
-#% required : yes
-#%End
-#%option
-#% key: undef
-#% type: double
-#% description: Pixel value to be interpreted as undefined (different from NULL)
-#% required : no
-#%End
-#%option
-#% key: eps
-#% type: string
-#% gisprompt: new_file,file,output
-#% description: Name of optional EPS output file
-#% required : no
-#%end
-#%flag
-#% key: x
-#% description: Plot using Xgraph
-#%end
-
-
-if [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." 1>&2
-    exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-#### check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message -e "awk required, please install awk or gawk first"
-    exit 1
-fi
-
-
-if [ -n "$GIS_OPT_EPS" ] && [ $GIS_FLAG_X -eq 1 ] ; then
-    g.message -e "Please select only one output method"
-    exit 1
-fi
-
-
-#### check if we have xgraph (if no EPS output requested)
-if [ $GIS_FLAG_X -eq 1 ] ; then
-  if [ ! -x "`which xgraph`" ] ; then
-    g.message -e "xgraph required, please install first (www.xgraph.org)"
-    exit 1
-  fi
-fi
-
-# set environment so that awk works properly in all locales
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-
-TMP="`g.tempfile pid=$$`"
-if [ $? -ne 0 ] || [ -z "${TMP}" ] ; then
-    g.message -e "unable to create temporary files"
-    exit 1
-fi
-#TMP=`dirname $TMP`
-
-wordcount()
-{
-     awk '
-     # Print list of word frequencies
-     {
-         for (i = 1; i <= NF; i++)
-             freq[$i]++
-	     total++
-     }
-
-     END {
-         for (word in freq)
-             printf "%s %d\n", word, freq[word]
-     }' $1
-}
-
-cleanup()
-{
-   \rm -f "${TMP}" "${TMP}_"*
-}
-
-#################################
-# this file contains everthing:
-r.stats -1 "$GIS_OPT_MAP" > "${TMP}_raw"
-TOTALNUMBER=`wc -l "${TMP}_raw" | awk '{print $1}'`
-
-g.message "Calculating statistics for polar diagram... (be patient)"
-
-#wipe out NULL data and undef data if defined by user
-# - generate degree binned to integer, eliminate NO DATA (NULL):
-# change 360 to 0 to close polar diagram:
-cat "${TMP}_raw" | grep -v '^\*$' | grep -v "^${GIS_OPT_UNDEF}$" | \
-    awk '{printf "%d\n", int($1 + .5)}' | sed 's+^360+0+g'  > "${TMP}_binned"
-
-# make radians
-cat "${TMP}_binned" | awk '{printf "%f\n", (3.14159265 * $1 ) / 180.}'  > "${TMP}_binned_radians"
-
-#################################
-# generate numbers for max circle
-TOTALVALIDNUMBER=`wc -l "${TMP}_binned_radians" | awk '{print $1}'`
-
-if [ "$TOTALVALIDNUMBER" -eq 0 ] ; then
-   g.message -e "No data pixel found"
-   cleanup
-   exit 1
-fi
-
-#################################
-# unit vector on raw data converted to radians without no data:
-cat "${TMP}_raw" | grep -v '^\*' | grep -v "^${GIS_OPT_UNDEF}$" | awk 'BEGIN {sum = 0.0}
-NR == 1{}
-       {sum += cos(3.14159265 * $1 / 180.)}
-END{print sum}' > "${TMP}_cos_sums"
-
-cat "${TMP}_raw" | grep -v '^\*' | grep -v "^${GIS_OPT_UNDEF}$" | awk 'BEGIN {sum = 0.0}
-NR == 1{}
-       {sum += sin(3.14159265 * $1 / 180.)}
-END{print sum}' > "${TMP}_sin_sums"
-
-# cos -> x, sin -> y
-echo "`cat "${TMP}_cos_sums"` $TOTALVALIDNUMBER" | awk '{printf "%.8f\n", $1/$2}' > "${TMP}_x_unit_vector"
-echo "`cat "${TMP}_sin_sums"` $TOTALVALIDNUMBER" | awk '{printf "%.8f\n", $1/$2}' > "${TMP}_y_unit_vector"
-UNITVECTOR=`paste -d' ' "${TMP}_x_unit_vector" "${TMP}_y_unit_vector"`
-
-#################################
-# how many are there?:
-wordcount "${TMP}_binned_radians" | sort -n -t ' ' -k 1 > "${TMP}_occurrences"
-
-# find the maximum value
-MAXRADIUS="`cat "${TMP}_occurrences" | sort -n -t ' ' -k 2 | tail -n 1 | cut -d' ' -f2`"
-
-# now do cos() sin()
-cat "${TMP}_occurrences" | awk '{printf "%f %f\n", cos($1) * $2 , sin($1) *$2}' > "${TMP}_sine_cosine"
-
-# to close the curve, we replicate the first value
-REPLICATE=`head -n 1 "${TMP}_sine_cosine"`
-echo "\"Real data angles"           >  "${TMP}_sine_cosine_replic"
-cat "${TMP}_sine_cosine" >> "${TMP}_sine_cosine_replic"
-echo $REPLICATE >> "${TMP}_sine_cosine_replic"
-
-PI=3.14159265358979323846
-if [ -n "$GIS_OPT_EPS" ] || [ $GIS_FLAG_X -eq 1 ] ; then
-  rm -f "${TMP}_outercircle"
-    echo "\"All Data incl. NULLs"           > "${TMP}_outercircle"
-
-  awk -v PI=$PI -v TOTAL=$TOTALNUMBER -v TOTALVALID=$TOTALVALIDNUMBER \
-      -v MAXRADIUS=$MAXRADIUS 'BEGIN {
-	for(i=0; i<=360; i++) {
-	    printf("%.8f %.8f\n",
-	      cos(i * PI/180) * TOTAL/TOTALVALID * MAXRADIUS,
-	      sin(i * PI/180) * TOTAL/TOTALVALID * MAXRADIUS)
-	}
-   }' >> "${TMP}_outercircle"
-fi
-
-
-# fix vector length to become visible (x? of $MAXRADIUS):
-AUTOSTRETCH="1"
-echo "\"Avg. Direction" > "${TMP}_vector"
-echo "0 0"         >> "${TMP}_vector"
-echo "$UNITVECTOR $MAXRADIUS $AUTOSTRETCH" | \
-    awk '{printf "%f %f\n", $1 * $3, $2 * $3}' >> "${TMP}_vector"
-
-
-###########################################################
-
-
-plot_xgraph()
-{
-# by M.Neteler
-echo "" > "${TMP}_newline"
-cat "${TMP}_sine_cosine_replic" "${TMP}_newline" "${TMP}_outercircle" \
-      "${TMP}_newline" "${TMP}_vector" | xgraph
-}
-
-
-
-plot_dgraph()
-{
-# by H.Bowman
-
-# use d.info and d.frame to create a square frame in the center of the window.
-FRAME_DIMS="`d.info -f | cut -f2- -d' '`"
-FRAME_WIDTH="`echo $FRAME_DIMS | awk '{printf("%d", $2 - $1)}'`"
-FRAME_HEIGHT="`echo $FRAME_DIMS | awk '{printf("%d", $4 - $3)}'`"
-
-# take shorter side as length of frame side
-if [ $FRAME_WIDTH -lt $FRAME_HEIGHT ] ; then
-    MIN_SIDE=$FRAME_WIDTH
-else
-    MIN_SIDE=$FRAME_HEIGHT
-fi
-
-DX="`echo $FRAME_WIDTH $MIN_SIDE | awk '{printf("%d", 0.5+(($1 - $2)/2) )}'`"
-DY="`echo $FRAME_HEIGHT $MIN_SIDE | awk '{printf("%d", 0.5+(($1 - $2)/2) )}'`"
-
-FRAME_LEFT="`echo $FRAME_DIMS | cut -f1 -d' '`"
-FRAME_TOP="`echo $FRAME_DIMS | cut -f3 -d' '`"
-
-# new square frame dims in pixels
-DFR_T=`expr $FRAME_TOP + $DY`
-DFR_L=`expr $FRAME_LEFT + $DX`
-DFR_B=`expr $DFR_T + $MIN_SIDE`
-DFR_R=`expr $DFR_L + $MIN_SIDE`
-
-WIN_DIMS="`d.info -d | cut -f2- -d' '`"
-WIN_WIDTH="`echo $WIN_DIMS | cut -f1 -d' '`"
-WIN_HEIGHT="`echo $WIN_DIMS | cut -f2 -d' '`"
-
-# new square frame dims in percentage of overal window
-# note d.info shows 0,0 as top left, d.frame expects 0%,0% as bottom left
-PER_T="`echo $DFR_B $WIN_HEIGHT | awk '{printf("%f", 100 - ($1 * 100. / $2) ) }'`"
-PER_B="`echo $DFR_T $WIN_HEIGHT | awk '{printf("%f", 100 - ($1 * 100. / $2) ) }'`"
-PER_L="`echo $DFR_L $WIN_WIDTH | awk '{printf("%f", $1 * 100. / $2 )}'`"
-PER_R="`echo $DFR_R $WIN_WIDTH | awk '{printf("%f", $1 * 100. / $2 )}'`"
-
-
-# save current frame name to restore later
-ORIG_FRAME="`d.frame -p`"
-
-# create square frame within current frame
-d.frame -c frame=d_polar.$$ at=$PER_T,$PER_B,$PER_L,$PER_R
-
-
-# polyline calculations
-RING=0.95
-SCALEVAL=`awk -v RING=$RING -v TOTAL=$TOTALNUMBER -v TOTALVALID=$TOTALVALIDNUMBER \
-    'BEGIN { print RING * TOTALVALID/TOTAL }'`
-
-cat "${TMP}_sine_cosine_replic" | tail -n +2 | awk -v SCL=$SCALEVAL -v MAX=$MAXRADIUS \
-    '{printf "%f %f\n", ((SCL * $1/MAX) +1)*50, ((SCL * $2/MAX) +1)*50}' \
-       > "${TMP}_sine_cosine_replic_normalized"
-
-# create circle
-awk -v RING=$RING -v PI=$PI 'BEGIN {
-   for(i=0; i<=360; i++) {
-     printf("%f %f\n", 50*(1+(RING * sin(i * (PI/180)))),
-	    50*(1+(RING * cos(i * (PI/180)))) )
-   }
- }' > "${TMP}_circle"
-
-# trend vector
-VECT=`cat "${TMP}_vector" | tail -n 1 | awk -v SCL=$SCALEVAL -v MAX=$MAXRADIUS \
-    '{printf "%f %f\n", ((SCL * $1/MAX)+1)*50, ((SCL * $2/MAX)+1)*50}'`
-
-
-# Possible TODOs:
-# To have d.polar survive d.redraw, write d.graph commands to a
-#  ${TMP}.dpolar.dgraph file and then use d.graph input=${TMP}.dpolar.dgraph.
-#  The file will be cleaned up when the grass session exits.
-#
-# To fill data area with color, use BOTH d.graph's polyline and polygon commands.
-#  Using polygon alone gives a jagged boundary due to sampling technique (not a bug).
-
-
-# plot it!
-d.erase
-d.graph << EOF
-
-  # draw circle
-  #   mandatory when drawing proportional to non-square frame
-  color 180:255:180
-  polyline
-    `cat "${TMP}_circle"`
-
-  # draw axes
-  color 180:180:180
-  width 0
-  move 0 50
-  draw 100 50
-  move 50 0
-  draw 50 100
-
-  # draw the goods
-  color red
-  width 0
-  polyline
-   `cat "${TMP}_sine_cosine_replic_normalized"`
-
-  # draw vector
-  color blue
-  width 3
-  move 50 50
-  draw $VECT
-
-  # draw compass text
-  color black
-  width 2
-  size 3 3
-  move 51 97
-   text N
-  move 51 1
-   text S
-  move 1 51
-   text W
-  move 97 51
-   text E
-
-  # draw legend text
-  width 0
-  size 2
-  color 0:180:0
-   move 1.5 96.5
-   text All data (incl. NULLs)
-  color red
-   move 1.5 93.5
-   text Real data angles
-  color blue
-   move 1.5 90.5
-   text Avg. direction
-
-EOF
-
-# back to original frame
-d.frame -s frame="$ORIG_FRAME"
-
-}
-
-
-
-plot_eps()
-{
-# EPS output (by M.Neteler and Bruno Caprile, ITC-irst)
-g.message "Generating $PSOUT ..."
-
-OUTERRADIUS=$MAXRADIUS
-EPSSCALE=0.1
-FRAMEALLOWANCE=1.1
-HALFFRAME=3000
-CENTER=$HALFFRAME,$HALFFRAME
-#SCALE=$HALFFRAME / ($OUTERRADIUS * $FRAMEALLOWANCE)
-SCALE=`echo $HALFFRAME $OUTERRADIUS $FRAMEALLOWANCE | awk '{printf "%f", $1/ ($2 * $3)}'`
-
-# DIAGRAMLINEWIDTH=CEILING ($HALFFRAME / 200)
-DIAGRAMLINEWIDTH=`echo $HALFFRAME | awk '{printf "%.1f", $1 / 400}'`  # ceil? 200
-# AXESLINEWIDTH=CEILING ($HALFFRAME / 500)
-AXESLINEWIDTH=`echo $HALFFRAME | awk '{printf "%.1f", $1 / 500}'` # ceil?
-# AXESFONTSIZE=CEILING ($HALFFRAME / 15)
-AXESFONTSIZE=`echo $HALFFRAME | awk '{printf "%.1f", $1 / 16}'` # ceil?
-# DIAGRAMFONTSIZE=CEILING ($HALFFRAME / 20)
-DIAGRAMFONTSIZE=`echo $HALFFRAME | awk '{printf "%.1f", $1 / 20}'` # ceil?
-HALFFRAME_2=`echo $HALFFRAME | awk '{printf "%.1f", $1 * 2}'`
-
-AVERAGEDIRECTIONCOLOR=1 #(blue)
-DIAGRAMCOLOR=4 #(red)
-CIRCLECOLOR=2 #(green)
-AXESCOLOR=0 #(black)
-
-NORTHJUSTIFICATION=2
-EASTJUSTIFICATION=6
-SOUTHJUSTIFICATION=8
-WESTJUSTIFICATION=8
-
-NORTHXSHIFT=`echo 1.02 $HALFFRAME | awk '{printf "%.1f", $1 * $2}'`
-NORTHYSHIFT=`echo 1.98 $HALFFRAME | awk '{printf "%.1f", $1 * $2}'`
-EASTXSHIFT=`echo 1.98 $HALFFRAME  | awk '{printf "%.1f", $1 * $2}'`
-EASTYSHIFT=`echo 1.02 $HALFFRAME  | awk '{printf "%.1f", $1 * $2}'`
-SOUTHXSHIFT=`echo 1.02 $HALFFRAME | awk '{printf "%.1f", $1 * $2}'`
-SOUTHYSHIFT=`echo 0.02 $HALFFRAME | awk '{printf "%.1f", $1 * $2}'`
-WESTXSHIFT=`echo 0.01 $HALFFRAME  | awk '{printf "%.1f", $1 * $2}'`
-WESTYSHIFT=`echo 1.02 $HALFFRAME  | awk '{printf "%.1f", $1 * $2}'`
-
-ALLDATASTRING="All Data (NULL included)"
-REALDATASTRING="Real Data Angles"
-AVERAGEDIRECTIONSTRING="Avg. Direction"
-
-LEGENDSX=`echo "1.95 $HALFFRAME" | awk '{printf "%.1f", $1 * $2}'`
-ALLDATALEGENDY=`echo "1.95 $HALFFRAME" | awk '{printf "%.1f", $1 * $2}'`
-REALDATALEGENDY=`echo "1.90 $HALFFRAME" | awk '{printf "%.1f", $1 * $2}'`
-AVERAGEDIRECTIONLEGENDY=`echo "1.85 $HALFFRAME" | awk '{printf "%.1f", $1 * $2}'`
-
-##########
-cat "${GISBASE}/etc/d.polar/ps_defs.eps" > "$PSOUT"
-
-echo "
-$EPSSCALE $EPSSCALE scale                           %% EPS-SCALE EPS-SCALE scale
-%%
-%% drawing axes
-%%
-
-col0                                    %% colAXES-COLOR
-$AXESLINEWIDTH setlinewidth                          %% AXES-LINEWIDTH setlinewidth
-[] 0 setdash
-newpath
- $HALFFRAME     0.0 moveto                  %% HALF-FRAME 0.0 moveto
- $HALFFRAME  $HALFFRAME_2 lineto                  %% HALF-FRAME (2 * HALF-FRAME) lineto
-    0.0  $HALFFRAME moveto                  %% 0.0 HALF-FRAME moveto
- $HALFFRAME_2  $HALFFRAME lineto                  %% (2 * HALF-FRAME) HALF-FRAME lineto
-stroke
-
-%%
-%% drawing outer circle
-%%
-
-col2                                    %% colCIRCLE-COLOR
-$DIAGRAMFONTSIZE /Times-Roman choose-font            %% DIAGRAM-FONTSIZE /Times-Roman choose-font
-$DIAGRAMLINEWIDTH setlinewidth                          %% DIAGRAM-LINEWIDTH setlinewidth
-[] 0 setdash
-newpath
-                                        %% coordinates of rescaled, translated outer circle follow
-                                        %% first point moveto, then lineto
-" >> "$PSOUT"
-
-SUBLENGTH=`wc -l "${TMP}_outercircle" | awk '{printf "%d", $1 - 2}'`
-LINE1=`head -n 2 "${TMP}_outercircle" | tail -n 1`
-echo $LINE1 $SCALE $HALFFRAME | awk '{printf "%.2f %.2f moveto\n", $1*$3+$4, $2*$3+$4}' >> "$PSOUT"
-
-tail -n $SUBLENGTH "${TMP}_outercircle" | sed "s+\$+ $SCALE $HALFFRAME+g" > "${TMP}_outercircle_lineto"
-
-cat "${TMP}_outercircle_lineto" | awk '{printf "%.2f %.2f lineto\n",$1*$3+$4, $2*$3+$4 }' >> "$PSOUT"
-rm -f "${TMP}_outercircle_lineto"
-
-echo "stroke
-
-%%
-%% axis titles
-%%
-
-col0                                    %% colAXES-COLOR
-$AXESFONTSIZE /Times-Roman choose-font            %% AXES-FONTSIZE /Times-Roman choose-font
-(N) $NORTHXSHIFT $NORTHYSHIFT $NORTHJUSTIFICATION just-string         %% NORTH-X-SHIFT NORTH-Y-SHIFT NORTH-JUSTIFICATION just-string
-(E) $EASTXSHIFT $EASTYSHIFT $EASTJUSTIFICATION just-string         %% EAST-X-SHIFT EAST-Y-SHIFT EAST-JUSTIFICATION just-string
-(S) $SOUTHXSHIFT $SOUTHYSHIFT $SOUTHJUSTIFICATION just-string           %% SOUTH-X-SHIFT SOUTH-Y-SHIFT SOUTH-JUSTIFICATION just-string
-(W) $WESTXSHIFT $WESTYSHIFT $WESTJUSTIFICATION just-string           %% WEST-X-SHIFT WEST-Y-SHIFT WEST-JUSTIFICATION just-string
-$DIAGRAMFONTSIZE /Times-Roman choose-font            %% DIAGRAM-FONTSIZE /Times-Roman choose-font
-
-
-%%
-%% drawing real data diagram
-%%
-
-col4                                    %% colDIAGRAM-COLOR
-$DIAGRAMLINEWIDTH setlinewidth                          %% DIAGRAM-LINEWIDTH setlinewidth
-[] 0 setdash
-newpath
-                                        %% coordinates of rescaled, translated diagram follow
-                                        %% first point moveto, then lineto
-" >> "$PSOUT"
-
-SUBLENGTH=`wc -l "${TMP}_sine_cosine_replic" | awk '{printf "%d", $1 - 2}'`
-LINE1=`head -n 2 "${TMP}_sine_cosine_replic" | tail -n 1`
-echo $LINE1 $SCALE $HALFFRAME | awk '{printf "%.2f %.2f moveto\n", $1*$3+$4, $2*$3+$4}' >> "$PSOUT"
-
-tail -n $SUBLENGTH "${TMP}_sine_cosine_replic" | \
-   sed "s+\$+ $SCALE $HALFFRAME+g" > "${TMP}_sine_cosine_replic_lineto"
-
-cat "${TMP}_sine_cosine_replic_lineto" | \
-   awk '{printf "%.2f %.2f lineto\n",$1*$3+$4, $2*$3+$4 }' >> "$PSOUT"
-
-rm -f "${TMP}_sine_cosine_replic_lineto"
-
-echo "stroke
-%%
-%% drawing average direction
-%%
-
-col1                                    %% colAVERAGE-DIRECTION-COLOR
-$DIAGRAMLINEWIDTH setlinewidth                          %% DIAGRAM-LINEWIDTH setlinewidth
-[] 0 setdash
-newpath
-                                        %% coordinates of rescaled, translated average direction follow
-                                        %% first point moveto, second lineto
-" >> $PSOUT
-
-SUBLENGTH=`wc -l "${TMP}_vector" | awk '{printf "%d", $1 - 2}'`
-LINE1=`head -n 2 "${TMP}_vector" | tail -n 1`
-echo $LINE1 $SCALE $HALFFRAME | awk '{printf "%.2f %.2f moveto\n", $1*$3+$4, $2*$3+$4}' >> "$PSOUT"
-
-tail -n $SUBLENGTH "${TMP}_vector" | sed "s+\$+ $SCALE $HALFFRAME+g" > "${TMP}_vector_lineto"
-
-cat "${TMP}_vector_lineto" | awk '{printf "%.2f %.2f lineto\n",$1*$3+$4, $2*$3+$4 }' >> "$PSOUT"
-rm -f "${TMP}_vector_lineto"
-
-echo "stroke
-
-%%
-%% drawing legends
-%%
-
-col2                                    %% colCIRCLE-COLOR
-%% Line below: (ALL-DATA-STRING) LEGENDS-X ALL-DATA-LEGEND-Y 4 just-string
-($ALLDATASTRING) $LEGENDSX $ALLDATALEGENDY 4 just-string
-
-col4                                    %% colDIAGRAM-COLOR
-%% Line below: (REAL-DATA-STRING) LEGENDS-X REAL-DATA-LEGEND-Y 4 just-string
-($REALDATASTRING) $LEGENDSX $REALDATALEGENDY 4 just-string
-
-col1                                    %% colAVERAGE-DIRECTION-COLOR
-%% Line below: (AVERAGE-DIRECTION-STRING) LEGENDS-X AVERAGE-DIRECTION-LEGEND-Y 4 just-string
-($AVERAGEDIRECTIONSTRING) $LEGENDSX $AVERAGEDIRECTIONLEGENDY 4 just-string
-" >> "$PSOUT"
-
-g.message "Done."
-}
-
-
-# Now output:
-
-if [ -n "$GIS_OPT_EPS" ] ; then
-   PSOUT="`basename $GIS_OPT_EPS .eps`.eps"
-   plot_eps
-else
-   if [ $GIS_FLAG_X -eq 1 ] ; then
-     plot_xgraph
-   else
-     plot_dgraph
-   fi
-fi
-
-
-g.message "Average vector:"
-echo "direction: `echo "$UNITVECTOR" | \
-  awk -v PI=$PI '{ print atan2($2, $1) * 180/PI }'` degrees CCW from East"
-echo "magnitude: `echo "$UNITVECTOR " | \
-  awk '{ print sqrt($1*$1 + $2*$2)*100 }'` percent of fullscale"
-
-
-cleanup
-exit 0

Deleted: grass/trunk/scripts/d.rast.edit/d.rast.edit
===================================================================
--- grass/trunk/scripts/d.rast.edit/d.rast.edit	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/d.rast.edit/d.rast.edit	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,102 +0,0 @@
-#!/bin/sh
-
-############################################################################
-#
-# MODULE:       d.rast.edit
-# AUTHOR(S):    Glynn Clements <glynn at gclements.plus.com>
-# COPYRIGHT:    (C) 2007 Glynn Clements
-#
-#  This program is free software; you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation; either version 2 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#############################################################################/
-
-#%Module
-#% description: Interactively edit cell values in a raster map.
-#% keywords: display, raster
-#%End
-#%Option
-#% key: input
-#% type: string
-#% required: yes
-#% multiple: no
-#% key_desc: name
-#% description: Name of input raster map
-#% gisprompt: old,cell,raster
-#%End
-#%Option
-#% key: output
-#% type: string
-#% required: yes
-#% multiple: no
-#% key_desc: name
-#% description: Name for output raster map
-#% gisprompt: new,cell,raster
-#%End
-#%Option
-#% key: aspect
-#% type: string
-#% required: no
-#% multiple: no
-#% key_desc: name
-#% description: Name of aspect raster map
-#% gisprompt: old,cell,raster
-#%End
-#%Option
-#% key: width
-#% type: integer
-#% required: no
-#% multiple: no
-#% description: Width of display canvas
-#% answer: 640
-#%End
-#%Option
-#% key: height
-#% type: integer
-#% required: no
-#% multiple: no
-#% description: Height of display canvas
-#% answer: 480
-#%End
-#%Option
-#% key: size
-#% type: integer
-#% required: no
-#% multiple: no
-#% description: Minimum size of each cell
-#% answer: 12
-#%End
-#%Option
-#% key: rows
-#% type: integer
-#% required: no
-#% multiple: no
-#% description: Maximum number of rows to load
-#% answer: 100
-#%End
-#%Option
-#% key: cols
-#% type: integer
-#% required: no
-#% multiple: no
-#% description: Maximum number of columns to load
-#% answer: 100
-#%End
-
-if test "$GISBASE" = ""; then
-    echo "You must be in GRASS GIS to run this program." >&2
-    exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    exec g.parser "$0" "$@"
-fi
-
-exec "$GRASS_WISH" "$GISBASE/etc/d.rast.edit.tcl"

Deleted: grass/trunk/scripts/d.rast.leg/d.rast.leg
===================================================================
--- grass/trunk/scripts/d.rast.leg/d.rast.leg	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/d.rast.leg/d.rast.leg	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,203 +0,0 @@
-#!/bin/sh
-
-##############################################################################
-# d.rast.leg	(GRASS Shell Script)
-#
-# displays a raster map and its legend on a graphics window. 
-#
-# Usage: 	d.rast.leg
-#	or	d.rast.leg help
-#	or	d.rast.leg rast_map [num_of_lines]
-#
-# Description:	d.rast.leg clears the entire screen, divides it into a main
-#		(left) and a minor (right) frames, and then display a raster 
-#		map in the main frame and the map legend in the minor frame.
-#		The user can run the program interactively or 
-#		non-interactively.
-#
-# Parameters: 	rast_map 	A raster map to be displayed.
-#
-#	 	num_of_lines 	Number of lines to appear in the legend. 
-#				If this number is not given, the legend frame 
-#				will display as many lines as number of 
-#				categories in the map, otherwise, it will
-#				display the first num_of_lines minus 1  
-#				categories with the rest being truncated. 
-# 
-# Note:		The user may adjust the num_of_lines parameter or the size of 
-#		graphics window to get an appropriate result.
-#
-# See also:	d.rast, d.legend.
-#
-# Jianping Xu and Scott Madry, Rutgers University. October 19, 1993
-# Markus Neteler 8/2002: added simple d.legend logic
-# Markus Neteler 10/2003: added g.parser
-# Michael Barton 12/2004: remove reference to (null)
-##############################################################################
-
-#%Module
-#%  description: Displays a raster map and its legend on a graphics window
-#%  keywords: display
-#%End
-#%flag
-#%  key: f
-#%  description: Flip legend
-#%end
-#%flag
-#%  key: n
-#%  description: Omit entries with missing label
-#%end
-#%option
-#% key: map
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: Name of raster map
-#% required : yes
-#%end
-#%option
-#% key: num_of_lines
-#% type: integer
-#% description: Number of lines to appear in the legend
-#% required : no
-#%end
-#%option
-#% key: rast
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: Name of raster map to generate legend from
-#% required : no
-#%end
-#%option
-#% key: title
-#% type: string
-#% description: Name of raster map to print in legend
-#% required : no
-#%end
-#%option
-#% key: position
-#% type: double
-#% description: Position of vertical map-legend separator (in percent)
-#% answer: 65
-#% required : no
-#%end
-
-if test "$GISBASE" = ""; then
- echo "You must be in GRASS GIS to run this program." >&2
- exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-  exec g.parser "$0" "$@"
-fi
-
-if [ $GIS_FLAG_N -eq 1 ] ; then
-  OMIT="-n"
-fi
-
-if [ $GIS_FLAG_F -eq 1 ] ; then
-  FLIP="-f"
-fi
-
-if [ ! -z $GIS_OPT_TITLE ] ; then
-   MAPNAME="$GIS_OPT_TITLE"
-else
-   MAPNAME="$GIS_OPT_MAP"
-fi
-
-#for -n flag of d.legend
-eval `g.findfile el=cell file=$GIS_OPT_MAP`
-if [ ! "$file" ] ; then
-   g.message -e "Raster map '$GIS_OPT_MAP' not found in mapset search path"
-   exit 1
-fi
-filemapset="${mapset}"
-HISTFILEDIR=$GISDBASE/$LOCATION_NAME/$filemapset/cell_misc/
-
-# for rast=
-if [ ! -z $GIS_OPT_RAST ] ; then 
-	eval `g.findfile el=cell file=$GIS_OPT_RAST`
-	if [ ! "$file" ] ; then
-	   g.message -e "Raster map '$GIS_OPT_RAST' not found in mapset search path"
-	   exit 1
-	fi
-fi
-
-# save defined font setting
-FONTCMD=`d.frame -l | grep d.font | sed 's+"++1'| sed 's+"++1'`
-d.frame -e
-
-# restore font setting
-$FONTCMD
-
-XPOS=$GIS_OPT_POSITION
-
-#at=bottom,top,left,right
-
-if [ -z "$GIS_OPT_NUM_OF_LINES" ]
-then
-
-       #draw title
-        d.frame -s at=90,100,$XPOS,100  frame=title
-#	if test -f $GISBASE/bin/d.text.freetype ; then
-#          d.text.freetype -sp text=$GIS_OPT_MAP col=black size=18 \
-#	         east_north=20,20 path=/usr/X11R6/lib/X11/fonts/TTF/luximb.ttf
-#	else
-          echo "$MAPNAME" | d.text col=black size=30
-#	fi
-
-       #draw legend
-    	d.frame -s at=0,90,$XPOS,100 frame=right
-	if [ -z $GIS_OPT_RAST ] ; then
-		if test -f $HISTFILEDIR/$GIS_OPT_MAP/histogram ; then
-	  	     d.legend $FLIP -n map=$GIS_OPT_MAP
-        	else
-	             d.legend $FLIP $OMIT map=$GIS_OPT_MAP
-        	fi
-	else
-		if test -f $HISTFILEDIR/$GIS_OPT_RAST/histogram ; then
-		     d.legend $FLIP -n map=$GIS_OPT_RAST
-		else
-		     d.legend $FLIP $OMIT map=$GIS_OPT_RAST
-		fi
-	fi
-
-       #draw map
-	d.frame -s at=0,100,0,$XPOS frame=left
-    	d.rast map=$GIS_OPT_MAP
-
-else
-
-       #draw title
-        d.frame -s at=90,100,$XPOS,100 frame=title
-#	if test -f $GISBASE/bin/d.text.freetype ; then
-#          d.text.freetype -sp text=$GIS_OPT_MAP col=black size=18 \
-#	         east_north=20,20 path=/usr/X11R6/lib/X11/fonts/TTF/luximb.ttf
-#	else
-          echo "$MAPNAME" | d.text col=black size=30
-#	fi
-
-       #draw legend
-    	d.frame -s at=0,90,$XPOS,100 frame=right
-	if [ -z $GIS_OPT_RAST ] ; then
-		if test -f $HISTFILEDIR/$GIS_OPT_MAP/histogram ; then
-	             d.legend $FLIP -n map=$GIS_OPT_MAP lines=$GIS_OPT_NUM_OF_LINES
-        	else
-	             d.legend $FLIP $OMIT map=$GIS_OPT_MAP
-        	fi
-	else
-		if test -f $HISTFILEDIR/$GIS_OPT_RAST/histogram ; then
-		     d.legend $FLIP -n map=$GIS_OPT_RAST lines=$GIS_OPT_NUM_OF_LINES
-		else
-		     d.legend $FLIP $OMIT map=$GIS_OPT_RAST
-		fi
-	fi
-
-       #draw map
-	d.frame -s at=0,100,0,$XPOS frame=left
-    	d.rast map=$GIS_OPT_MAP
-fi
-
-
-#d.frame -s frame=full_screen
-g.message "Clear screen with:"
-g.message "d.erase -f"

Deleted: grass/trunk/scripts/d.shadedmap/d.shadedmap
===================================================================
--- grass/trunk/scripts/d.shadedmap/d.shadedmap	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/d.shadedmap/d.shadedmap	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,53 +0,0 @@
-#!/bin/sh
-#
-############################################################################
-#
-# MODULE:	d.shadedmap
-# AUTHOR(S):	Unknown; updated to GRASS 5.7 by Michael Barton 
-# PURPOSE:	Uses d.his to drape a color raster over a shaded relief map
-# COPYRIGHT:	(C) 2004 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-#############################################################################
-
-
-#%Module
-#% description: Drapes a color raster over a shaded relief map using d.his
-#%End
-#%option
-#% key: reliefmap
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: Name of shaded relief or aspect map
-#% required : yes
-#%end
-#%option
-#% key: drapemap
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: Name of raster to drape over relief map
-#% required : yes
-#%end
-#%option
-#% key: brighten
-#% type: integer
-#% description: Percent to brighten
-#% options: -99-99
-#% answer: 0
-#%end
-
-
-if  [ -z "$GISBASE" ] ; then
-  echo "You must be in GRASS GIS to run this program." 1>&2
-  exit 1
-fi   
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-  exec g.parser "$0" "$@"
-fi
-
-exec d.his "h_map=$GIS_OPT_DRAPEMAP" "i_map=$GIS_OPT_RELIEFMAP" \
-	"brighten=$GIS_OPT_BRIGHTEN"

Deleted: grass/trunk/scripts/db.dropcol/db.dropcol
===================================================================
--- grass/trunk/scripts/db.dropcol/db.dropcol	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/db.dropcol/db.dropcol	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,168 +0,0 @@
-#!/bin/sh
-
-############################################################################
-#
-# MODULE:       db.dropcolumn
-# AUTHOR(S):   	Markus Neteler
-# PURPOSE:      interface to db.execute to drop a column from an 
-#               attribute table
-#               - with special trick for SQLite
-# COPYRIGHT:    (C) 2007 by Markus Neteler and the GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-#############################################################################
-
-
-#%Module
-#%  description: Drops a column from selected attribute table
-#%  keywords: database, attribute table
-#%End
-
-#%flag
-#%  key: f
-#%  description: Force removal (required for actual deletion of files)
-#%end
-
-#%option
-#% key: table
-#% type: string
-#% key_desc : name
-#% description: Table from which to drop attribute column
-#% required : yes
-#% gisprompt: old,dbtable,dbtable
-#%end
-
-#%option
-#% key: column
-#% type: string
-#% description: Name of the column
-#% required : yes
-#% gisprompt: old,dbcolumn,dbcolumn
-#%end
-
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." >&2
- exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-  exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-#### check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message -e "awk required, please install awk or gawk first"
-    exit 1
-fi
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-#### setup temporary file
-TMP="`g.tempfile pid=$$`"
-if [ $? -ne 0 ] || [ -z "$TMP" ] ; then
-    g.message -e "Unable to create temporary files" 
-    exit 1
-fi
-
-cleanup()
-{
- \rm -f "$TMP" "$TMP.coltypes" "$TMP.colnames" "$TMP.coldesc"
-}
-
-# what to do in case of user break:
-exitprocedure()
-{
-   g.message -e 'User break!'
-   cleanup
-   exit 1
-}
-# shell check for user break (signal list: trap -l)
-trap "exitprocedure" 2 3 15
-
-### setup enviro vars ###
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-
-table="$GIS_OPT_TABLE"
-
-# check if DB parameters are set, and if not set them.
-db.connect -c
-
-database=`db.connect -p | grep '^database' | cut -d ':' -f2`
-driver=`db.connect -p | grep '^driver' | cut -d ':' -f2`
-# schema needed for PG?
-col="$GIS_OPT_COLUMN"
-
-force=$GIS_FLAG_F
-if [ $force -eq 1 ] ; then
-   g.message "Forcing ..."
-fi
-
-
-if [ "$col" = "cat" ] ; then
-   g.message -w "Deleting <$col> column which may be needed to keep table\
-      connected to a vector map"
-   #cleanup
-   #exit 1
-fi
-
-db.describe -c $GIS_OPT_TABLE | grep '^Column ' | cut -d':' -f2 | grep "^ ${col}" 2>&1 >/dev/null
-if [ $? -ne 0 ] ; then
-	g.message -e "Column <$col> not found in table"
-	cleanup
-	exit 1
-fi
-
-if [ $force -eq 0 ] ; then
-    g.message "The <$col> column would be deleted."
-    g.message message=""
-    g.message "You must use the force flag to actually remove it. Exiting."
-    exit 0
-fi
-
-
-if [ "$driver" = "sqlite" ] ; then
-	#echo "Using special trick for SQLite"
-	# http://www.sqlite.org/faq.html#q13
-	db.describe -c $table | grep '^Column ' | cut -d':' -f2,3 | grep -v "${col}:" > "$TMP.coldesc"
-	cat "$TMP.coldesc" | cut -d':' -f2 > "$TMP.coltypes"
-	cat "$TMP.coldesc" | cut -d':' -f1 > "$TMP.colnames"
-	COLDEF=`paste -d' ' "$TMP.colnames" "$TMP.coltypes" | tr '\n' ',' | sed 's+,$++g'`
-	COLNAMES=`cat "$TMP.colnames" | tr '\n' ',' | sed 's+,$++g'`
-echo "BEGIN TRANSACTION;
-CREATE TEMPORARY TABLE ${table}_backup(${COLDEF});
-INSERT INTO ${table}_backup SELECT ${COLNAMES} FROM ${table};
-DROP TABLE ${table};
-CREATE TABLE ${table}(${COLDEF});
-INSERT INTO ${table} SELECT ${COLNAMES} FROM ${table}_backup;
-DROP TABLE ${table}_backup;
-COMMIT;" > "$TMP"
-	db.execute input="$TMP"
-	if [ $? -eq 1 ] ; then
-	    	g.message -e "Cannot continue (problem deleting column)."
-	    	cleanup
-	    	exit 1
-	fi
-else
-	echo "ALTER TABLE $table DROP COLUMN $col" | db.execute database="${database}" driver=${driver}
-	if [ $? -eq 1 ] ; then
-	    	g.message -e "Cannot continue (problem deleting column)."
-	    	cleanup
-	    	exit 1
-	fi
-fi
-
-# cleanup
-cleanup
-
-exit 0
-

Deleted: grass/trunk/scripts/db.droptable/db.droptable
===================================================================
--- grass/trunk/scripts/db.droptable/db.droptable	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/db.droptable/db.droptable	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,110 +0,0 @@
-#!/bin/sh
-
-############################################################################
-#
-# MODULE:       db.droptable
-# AUTHOR(S):   	Markus Neteler
-# PURPOSE:      interface to db.execute to drop an attribute table
-# COPYRIGHT:    (C) 2007 by Markus Neteler and the GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-#############################################################################
-
-
-#%Module
-#%  description: Drops an attribute table.
-#%  keywords: database, attribute table
-#%End
-
-#%flag
-#%  key: f
-#%  description: Force removal (required for actual deletion of files)
-#%end
-
-#%option
-#% key: table
-#% type: string
-#% key_desc : name
-#% description: Table to drop
-#% required : yes
-#% gisprompt: old,dbtable,dbtable
-#%end
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." >&2
- exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-  exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-# what to do in case of user break:
-exitprocedure()
-{
-   g.message -e 'User break!'
-   exit 1
-}
-# shell check for user break (signal list: trap -l)
-trap "exitprocedure" 2 3 15
-
-### setup enviro vars ###
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-
-table="$GIS_OPT_TABLE"
-
-# check if DB parameters are set, and if not set them.
-db.connect -c
-
-database=`db.connect -p | grep '^database' | cut -d ':' -f2`
-driver=`db.connect -p | grep '^driver' | cut -d ':' -f2`
-# schema needed for PG?
-col="$GIS_OPT_COLUMN"
-
-force=$GIS_FLAG_F
-if [ $force -eq 1 ] ; then
-   g.message "Forcing ..."
-fi
-
-# check if table exists
-db.describe -c "$GIS_OPT_TABLE" >/dev/null 2>/dev/null
-if [ $? -ne 0 ] ; then
-   g.message -e "Table <$table> not found in current mapset"
-   exit 1
-fi
-
-# check if table is used somewhere (connected to vector map)
-USEDINMAPS="`grep $table ${GISDBASE}/${LOCATION_NAME}/*/vector/*/dbln | cut -d':' -f1 | sed 's+/dbln++g'`"
-if  [ ! -z "$USEDINMAPS" ] ; then
-   g.message -w "Deleting <$table> table which is attached to following map(s):"
-   for i in $USEDINMAPS ; do
-       echo "`basename $i`"
-   done
-fi
-
-if [ $force -eq 0 ] ; then
-    g.message "The <$table> table would be deleted."
-    g.message message=""
-    g.message "You must use the force flag to actually remove it. Exiting."
-    exit 0
-fi
-
-
-echo "DROP TABLE $table" | db.execute database="${database}" driver=${driver}
-if [ $? -eq 1 ] ; then
-  	g.message -e "Cannot continue (problem deleting column)."
-    	exit 1
-fi
-
-exit 0

Deleted: grass/trunk/scripts/db.in.ogr/db.in.ogr
===================================================================
--- grass/trunk/scripts/db.in.ogr/db.in.ogr	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/db.in.ogr/db.in.ogr	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,147 +0,0 @@
-#!/bin/sh
-
-############################################################################
-#
-# MODULE:       db.in.ogr
-# AUTHOR(S):   	Markus Neteler
-# PURPOSE:      imports attribute tables in various formats
-# COPYRIGHT:    (C) 2007 by Markus Neteler and the GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-#############################################################################
-
-#%Module
-#%  description: Imports attribute tables in various formats.
-#%  keywords: database, attribute table
-#%End
-
-#%option
-#% key: dsn
-#% type: string
-#% key_desc : name
-#% gisprompt: old_file,file,input
-#% description: Table file to be imported or DB connection string
-#% required : yes
-#%end
-
-#%option
-#% key: db_table
-#% type: string
-#% key_desc : name
-#% description: Table name of SQL DB table
-#% required : no
-#%end
-
-#%option
-#% key: output
-#% type: string
-#% description: Name for output table
-#% required : no
-#%end
-
-#%option
-#% key: key
-#% type: string
-#% description: Name for auto-generated unique key column
-#% required : no
-#%end
-
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." >&2
- exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-  exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-
-# what to do in case of user break:
-exitprocedure()
-{
- g.message -e 'User break!'
- exit 1
-}
-# shell check for user break (signal list: trap -l)
-trap "exitprocedure" 2 3 15
-
-### setup enviro vars ###
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-
-# check if we want to connect to real DB
-if [ ! -z "$GIS_OPT_DB_TABLE" ] ; then
-  INPUT=$GIS_OPT_DB_TABLE
-else
-  INPUT=$GIS_OPT_DSN
-fi
-
-if [ -z "$GIS_OPT_OUTPUT" ] ; then
-  # file name laundery
-  TMPNAME=`echo "$INPUT" | tr -s '.' '_'`
-  GIS_OPT_OUTPUT=`basename "$TMPNAME"`
-fi
-
-if [ -z "$GRASS_OVERWRITE" ] ; then
-  if [ `db.tables -p | grep "^${GIS_OPT_OUTPUT}$"` ] ; then
-     g.message -e "Table <${GIS_OPT_OUTPUT}> already exists"
-     exit 1
-  fi
-else
-  # user gave --o
-  echo "DROP TABLE ${GIS_OPT_OUTPUT}" | db.execute
-fi
-
-# treat DB as real vector map...
-if [ ! -z "$GIS_OPT_DB_TABLE" ] ; then
-  LAYER="layer=$GIS_OPT_DB_TABLE"
-fi
-
-# check ERRORs and cat and cat_ issues (maybe problem with translated messages)
-WARNING="`v.in.ogr --q dsn=\"$GIS_OPT_DSN\" $LAYER out=$GIS_OPT_OUTPUT -o 2>&1 | grep 'ERROR\|cat' | grep -v 'truncated'`"
-#if [ $? -ne 0 ] ;  then
-if [ ! -z "$WARNING" ] ; then
-   if [ ! -z "$GIS_OPT_DB_TABLE" ] ; then
-      g.message -e "Input DSN <$INPUT> not found or not readable"
-   else
-      g.message -e "Input table <$INPUT> not found or not readable"
-   fi
-   exit 1
-fi
-
-# rename ID col if requested from cat to new name
-if [ ! -z ${GIS_OPT_KEY} ] ; then
-   v.db.renamecol --q $GIS_OPT_OUTPUT layer=1 column=cat,${GIS_OPT_KEY} 2> /dev/null > /dev/null
-fi
-
-# ... and immediately drop the empty geometry
-eval `g.findfile element=vector file=$GIS_OPT_OUTPUT mapset=$MAPSET`
-if [ ! "$file" ] ; then
-   g.message -e "Something went wrong. Should not happen"
-   exit 1
-else
-   # remove the vector part
-   rm -rf "$file"
-fi
-
-# get rid of superfluous auto-added cat column (and cat_ if present)
-db.dropcol --q -f $GIS_OPT_OUTPUT colum=cat >/dev/null 2>/dev/null
-if [ ! -z "$WARNING" ] ; then
-   db.dropcol --q -f $GIS_OPT_OUTPUT colum=cat_ >/dev/null 2>/dev/null
-fi
-
-RECORDS=`db.describe -c $GIS_OPT_OUTPUT | grep '^nrows' | sed 's+ ++g' | cut -d':' -f2`
-g.message "Imported table <$GIS_OPT_OUTPUT> with $RECORDS rows"
-exit 0
-

Deleted: grass/trunk/scripts/db.out.ogr/db.out.ogr
===================================================================
--- grass/trunk/scripts/db.out.ogr/db.out.ogr	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/db.out.ogr/db.out.ogr	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,129 +0,0 @@
-#!/bin/sh
-
-############################################################################
-#
-# MODULE:       db.out.ogr
-# AUTHOR(S):   	Markus Neteler
-# PURPOSE:      exports attribute tables into various formats
-# COPYRIGHT:    (C) 2007 by Markus Neteler and the GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-#############################################################################
-
-#%Module
-#%  description: Exports attribute tables into various formats.
-#%  keywords: database, attribute table
-#%End
-
-#%option
-#% key: input
-#% type: string
-#% key_desc : name
-#% description: GRASS table name
-#% required : yes
-#%end
-
-#%option
-#% key: dsn
-#% type: string
-#% key_desc : name
-#% gisprompt: new_file,file,input
-#% description: Table file to be exported or DB connection string
-#% required : yes
-#%end
-
-#%option
-#% key: format
-#% type: string
-#% description: Table format
-#% required : yes
-#% options: CSV,DBF,GML,MySQL,PostgreSQL,SQLite
-#% answer: DBF
-#%end
-
-#%option
-#% key: db_table
-#% type: string
-#% key_desc : name
-#% description: Name for output table
-#% required : no
-#%end
-
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." >&2
- exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-  exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-
-# what to do in case of user break:
-exitprocedure()
-{
- g.message -e 'User break!'
- exit 1
-}
-# shell check for user break (signal list: trap -l)
-trap "exitprocedure" 2 3 15
-
-### setup enviro vars ###
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-
-if [ "$GIS_OPT_FORMAT" = "DBF" -o  "$GIS_OPT_FORMAT" = "dbf" ] ; then
-  GIS_OPT_FORMAT="ESRI_Shapefile"
-fi
-
-if [ "$GIS_OPT_FORMAT" = "CSV" ] ; then
-  OLAYER="olayer=`basename $GIS_OPT_DSN .csv`"
-fi
-
-#is there a simpler way of testing for --overwrite?
-if [ -e "$GIS_OPT_INPUT.dbf" ] ; then
-   if [ -z "$GRASS_OVERWRITE" ] || [ "$GRASS_OVERWRITE" -ne 1 ] ; then
-      g.message -e "File <$GIS_OPT_INPUT.dbf> already exists"
-      exit 1
-   fi
-fi
-  
-v.out.ogr --q $GIS_OPT_INPUT dsn="$GIS_OPT_DSN" $OLAYER format=$GIS_OPT_FORMAT type=point
-if [ $? -ne 0 ] ;  then
-   exit 1
-fi
-
-if [ "$GIS_OPT_FORMAT" = "ESRI_Shapefile" ] ; then
-  echo "$GIS_OPT_DSN" | grep '\.dbf$' > /dev/null
-  if [ $? -eq 0 ] ; then
-    OUTNAME="`basename $GIS_OPT_DSN .dbf`"
-    rm -f "$OUTNAME.shp" "$OUTNAME.shx" "$OUTNAME.prj"
-    OUTNAME="$OUTNAME.dbf"
-  else
-    rm -f "$GIS_OPT_DSN/$GIS_OPT_INPUT.shp" \
-          "$GIS_OPT_DSN/$GIS_OPT_INPUT.shx" \
-          "$GIS_OPT_DSN/$GIS_OPT_INPUT.prj"
-    OUTNAME="$GIS_OPT_DSN/$GIS_OPT_INPUT.dbf"
-  fi
-else
-  if [ "$GIS_OPT_FORMAT" = "CSV" ] ; then
-     OUTNAME="$GIS_OPT_DSN".csv
-  else
-     OUTNAME="$GIS_OPT_INPUT"
-  fi
-fi
-
-g.message "Exported table <$OUTNAME>"
-exit 0
-

Deleted: grass/trunk/scripts/db.test/db.test
===================================================================
--- grass/trunk/scripts/db.test/db.test	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/db.test/db.test	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,90 +0,0 @@
-#!/bin/sh
-############################################################################
-#
-# MODULE:	db.test
-# AUTHOR(S):	Radim Blazek
-# PURPOSE:	Test database driver
-# COPYRIGHT:	(C) 2004 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (version 2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-#############################################################################
-
-#% Module
-#%  description: Test database driver, database must exist and set by db.connect.
-#%  keywords: database, attribute table
-#% End
-#% option
-#%  key: test
-#%  type: string
-#%  description: Test name
-#%  required : yes
-#%  options : test1
-#% end
-
-if test "$GISBASE" = ""; then
-    echo "You must be in GRASS GIS to run this program." >&2
-    exit 1
-fi
-
-if   [ "$1" != "@ARGS_PARSED@" ]
-then
-        exec g.parser "$0" "$@"
-fi
-
-test_file="$GIS_OPT_TEST"
-
-expected=`g.tempfile pid=$$`
-result=`g.tempfile pid=$$`
-
-while read TYPE
-do
-    read SQL
-    echo "$SQL"
-
-    # Copy expected result to temp file
-
-    cat /dev/null > "$expected"
-
-    if [ $TYPE = "X" ]
-    then
-        echo "$SQL" | db.execute
-    else
-        echo "$SQL" | db.select -c > "$result"
-    fi
-
-    if [ $? -ne 0 ]
-    then
-        g.message -e "EXECUTE: ******** ERROR ********" 
-    else
-        g.message "EXECUTE: OK" 
-    fi
-
-    while read RES
-    do
-	if [ -z "$RES" ]
-        then
-	    break
-        fi
-	echo $RES >> "$expected"
-    done
-
-    if [ $TYPE = "S" ]
-    then
-	diff "$result" "$expected"
-
-	if [ $? -ne 0 ]
-	then
-            g.message -e "RESULT: ******** ERROR ********" 
-	else
-            g.message "RESULT: OK" 
-	fi
-    fi
-
-done < "$GISBASE/etc/db.test/$test_file"
-
-
-exit 0
-

Deleted: grass/trunk/scripts/g.manual/g.manual
===================================================================
--- grass/trunk/scripts/g.manual/g.manual	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/g.manual/g.manual	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,136 +0,0 @@
-#!/bin/sh
-############################################################################
-#
-# MODULE:	g.manual
-# AUTHOR(S):	Markus Neteler
-# PURPOSE:	Display the HTML/MAN pages
-# COPYRIGHT:	(C) 2003 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-#############################################################################
-
-#%Module
-#%  description: Display the HTML man pages of GRASS
-#%  keywords: general, manual, help
-#%End
-#%flag
-#%  key: i
-#%  description: Display index
-#%End
-#%flag
-#%  key: m
-#%  description: Display as MAN text page instead of HTML page in browser
-#%End
-#%option
-#% key: entry
-#% type: string
-#% description: Manual entry to be displayed
-#% required : no
-#%End
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." >&2
-    exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    exec g.parser "$0" "$@"
-fi
-
-check_docbase()
-{
-    #hack for cygwin:
-    if [ "$OSTYPE" = "cygwin" ] ; then
-        if  [ -z "$CYGWIN_ROOT" ] ; then
-            CYGWIN_ROOT="\cygwin"
-        fi
-        for i in C D E F G H I J K L M N O P Q R S T U V W X Y Z NOT_FOUND
-        do
-            j="$i:$CYGWIN_ROOT$1"
-            if [ -f "$j"/docs/html/index.html ] ; then
-                break
-            fi
-        done
-        if [ "$i" = "NOT_FOUND" ] ; then
-            g.message -e "Cannot find GRASS document base."
-            exit 1
-        fi
-        echo "$j"
-    else
-        if [ -f "$1"/docs/html/index.html ] ; then
-            echo "$1"
-        fi
-    fi
-    echo ""
-}
-
-start_browser()
-{
-  if test ! -f "$GRASS_DOC_BASE"/docs/html/$1.html -a -n $1 ; then
-    g.message -e "No HTML manual page entry for <$1>."
-    exit 1
-  else
-    if [ -z "$GRASS_VERBOSE" ] || [ "$GRASS_VERBOSE" -gt 1 ] ; then
-	g.message "Starting browser <$BROWSERNAME> for module $1..."
-    fi
-    "$GRASS_HTML_BROWSER" file://"$GRASS_DOC_BASE"/docs/html/$1.html
-  fi
-}
-
-start_man()
-{
-  if test ! -f "$GRASS_DOC_BASE"/man/man1/$1.1 -a -n $1 ; then
-    if test ! -f "$GRASS_DOC_BASE"/man/man1/$1.1.gz -a -n $1 ; then
-       echo "ERROR: no MAN page entry for <$1>." 1>&2
-       exit 1
-    else
-       man "$GRASS_DOC_BASE"/man/man1/$1.1.gz
-    fi
-    g.message -e "No MAN page entry for <$1>."
-    exit 1
-  else
-    man "$GRASS_DOC_BASE"/man/man1/$1.1
-  fi
-}
-
-GRASS_DOC_BASE=`check_docbase "$GISBASE"`
-
-#hack for MacOSX:
-ISMAC=`echo "$GRASS_HTML_BROWSER" | grep "html_browser_mac.sh"`
-if [ ! -z "$ISMAC" ] ; then
-    BROWSERNAME=`echo "$GRASS_HTML_BROWSER_MACOSX" | cut -d . -f 3`
-#hack for Cygwin:
-elif [ "$OSTYPE" = "cygwin" ] ; then
-    BROWSERNAME=`basename "$GRASS_HTML_BROWSER" | sed 's/\.exe$//i'`
-else
-    BROWSERNAME="$GRASS_HTML_BROWSER"
-fi
-
-#keep order!
-#first test for index...
-if [ $GIS_FLAG_I -eq 1 ] ; then
-  if [ $GIS_FLAG_M -eq 1 ] ; then
-    start_man index
-    exit 0
-  else
-    start_browser index
-    exit 0
-  fi
-fi
-
-#... then for help parameter:
-if [ -z "$GIS_OPT_ENTRY" ] ; then
- g.manual help
- exit 0
-fi
-
-if [ $GIS_FLAG_M -eq 1 ] ; then
-  start_man "$GIS_OPT_ENTRY"
-else
-  start_browser "$GIS_OPT_ENTRY"
-fi
-
-exit 0

Deleted: grass/trunk/scripts/i.fusion.brovey/i.fusion.brovey
===================================================================
--- grass/trunk/scripts/i.fusion.brovey/i.fusion.brovey	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/i.fusion.brovey/i.fusion.brovey	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,236 +0,0 @@
-#!/bin/sh
-
-############################################################################
-#
-# MODULE:	i.fusion.brovey
-# AUTHOR(S):	Markus Neteler. <neteler itc it>
-# PURPOSE:	Brovey transform to merge
-#                 - LANDSAT-7 MS (2, 4, 5) and pan (high res)
-#                 - SPOT MS and pan (high res)
-#                 - QuickBird MS and pan (high res)
-#
-# COPYRIGHT:	(C) 2002-2008 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-# REFERENCES:
-#             (?) Roller, N.E.G. and Cox, S., 1980. Comparison of Landsat MSS
-#                and merged MSS/RBV data for analysis of natural vegetation.
-#                Proc. of the 14th International Symposium on Remote Sensing
-#                of Environment, San Jose, Costa Rica, 23-30 April, pp. 1001-1007.
-#
-#               for LANDSAT 5: see Pohl, C 1996 and others
-#
-# TODO:         add overwrite test at beginning of the script
-#############################################################################
-
-#%Module
-#%  description: Brovey transform to merge multispectral and high-res panchromatic channels
-#%  keywords: raster, imagery, fusion
-#%End
-#%Flag
-#%  key: l
-#%  description: sensor: LANDSAT
-#%END
-#%Flag
-#%  key: q
-#%  description: sensor: QuickBird
-#%END
-#%Flag
-#%  key: s
-#%  description: sensor: SPOT
-#%END
-#%option
-#% key: ms1
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: raster input map (green: tm2 | qbird_green | spot1)
-#% required : yes
-#%end
-#%option
-#% key: ms2
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: raster input map (NIR: tm4 | qbird_nir | spot2)
-#% required : yes
-#%end
-#%option
-#% key: ms3
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: raster input map (MIR; tm5 | qbird_red | spot3)
-#% required : yes
-#%end
-#%option
-#% key: pan
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: raster input map (etmpan | qbird_pan | spotpan)
-#% required : yes
-#%end
-#%option
-#% key: outputprefix
-#% type: string
-#% gisprompt: new,cell,raster
-#% description: raster output map prefix (e.g. 'brov')
-#% required : yes
-#%end
-
-
-if test "$GISBASE" = ""; then
-   echo "You must be in GRASS GIS to run this program." >&2
-   exit 1
-fi
-
-# save command line
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    CMDLINE="`basename $0`"
-    for arg in "$@" ; do
-        CMDLINE="$CMDLINE \"$arg\""
-    done
-    export CMDLINE
-    exec g.parser "$0" "$@"
-fi
-
-
-cleanup()
-{
-   #remove temporary region file
-   unset WIND_OVERRIDE
-   g.remove region="i.fusion.brovey.$TMP" --quiet
-}
-
-# what to do in case of user break:
-exitprocedure()
-{
-   g.message -e message='User break!'
-   cleanup
-   exit 1
-}
-
-# shell check for user break (signal list: trap -l)
-trap "exitprocedure" 2 3 15
-
-
-
-#### check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message -e "awk required, please install awk or gawk first" 
-    exit 1
-fi
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-TMP=$$
-
-if [ $GIS_FLAG_S -eq 0 -a $GIS_FLAG_L -eq 0 -a $GIS_FLAG_Q -eq 0 ] ; then
-   g.message -e "Please select a flag to specify the satellite sensor"
-   exit 1
-fi
-
-#get PAN resolution:
-PANRES=`r.info "$GIS_OPT_PAN" | grep Res | tr -s ' ' ' ' | cut -d':' -f4 | cut -d' ' -f2 | tr '\n' ' '  | awk '{printf "%f\n", ($1+$2) / 2.}'`
-if [ $? -ne 0 ] ; then
-   g.message -e "An error occurred while parsing r.info output"
-   exit 1
-fi
-
-# clone current region
-g.region save="i.fusion.brovey.$TMP"
-
-g.message message="Using resolution from PAN: $PANRES"
-WIND_OVERRIDE="i.fusion.brovey.$TMP"
-export WIND_OVERRIDE
-g.region res="$PANRES" -a
-
-g.message "Performing Brovey transformation..."
-
-# The formula was originally developed for LANDSAT-TM5 and SPOT, 
-# but it also works well with LANDSAT-TM7
-# LANDSAT formula:
-#  r.mapcalc "brov.red=1. *  tm.5 / (tm.2 + tm.4 + tm.5) * etmpan"
-#  r.mapcalc "brov.green=1. * tm.4 /(tm.2 + tm.4 + tm.5) * etmpan"
-#  r.mapcalc "brov.blue=1. * tm.2 / (tm.2 + tm.4 + tm.5) * etmpan"
-#
-# SPOT formula:
-# r.mapcalc "brov.red= 1.  * spot.ms.3 / (spot.ms.1 + spot.ms.2 + spot.ms.3) * spot.p"
-# r.mapcalc "brov.green=1. * spot.ms.2 / (spot.ms.1 + spot.ms.2 + spot.ms.3) * spot.p"
-# r.mapcalc "brov.blue= 1. * spot.ms.1 / (spot.ms.1 + spot.ms.2 + spot.ms.3) * spot.p"
-# note: for RGB composite then revert brov.red and brov.green!
-
-g.message message="Calculating $GIS_OPT_OUTPUTPREFIX.red: ...(step 1/4)"
-r.mapcalc "\"$GIS_OPT_OUTPUTPREFIX.red\" = 1. * \"$GIS_OPT_MS3\" / (\"$GIS_OPT_MS1\" + \"$GIS_OPT_MS2\" + \"$GIS_OPT_MS3\") * \"$GIS_OPT_PAN\""
-if [ $? -ne 0 ] ; then
-   g.message -e "An error occurred while running r.mapcalc"
-   cleanup
-   exit 1
-fi
-
-g.message message="Calculating $GIS_OPT_OUTPUTPREFIX.green: ...(step 2/4)"
-r.mapcalc "\"$GIS_OPT_OUTPUTPREFIX.green\" = 1. * \"$GIS_OPT_MS2\" / (\"$GIS_OPT_MS1\" + \"$GIS_OPT_MS2\" + \"$GIS_OPT_MS3\") * \"$GIS_OPT_PAN\""
-if [ $? -ne 0 ] ; then
-   g.message -e "An error occurred while running r.mapcalc"
-   cleanup
-   exit 1
-fi
-
-g.message message="Calculating $GIS_OPT_OUTPUTPREFIX.blue: ...(step 3/4)"
-r.mapcalc "\"$GIS_OPT_OUTPUTPREFIX.blue\" = 1. * \"$GIS_OPT_MS1\" / (\"$GIS_OPT_MS1\" + \"$GIS_OPT_MS2\" + \"$GIS_OPT_MS3\") * \"$GIS_OPT_PAN\""
-if [ $? -ne 0 ] ; then
-   g.message -e "An error occurred while running r.mapcalc"
-   cleanup
-   exit 1
-fi
-
-# Maybe?
-#r.colors   $GIS_OPT_OUTPUTPREFIX.red col=grey
-#r.colors   $GIS_OPT_OUTPUTPREFIX.green col=grey
-#r.colors   $GIS_OPT_OUTPUTPREFIX.blue col=grey
-#to blue-ish, therefore we modify
-#r.colors $GIS_OPT_OUTPUTPREFIX.blue col=rules << EOF
-#5 0 0 0
-#20 200 200 200
-#40 230 230 230
-#67 255 255 255
-#EOF
-
-if [ $GIS_FLAG_S -eq 1 ] ; then
-   #apect table is nice for SPOT:
-   g.message message="Assigning color tables for SPOT ...(step 4/4)"
-   r.colors "$GIS_OPT_OUTPUTPREFIX.blue" col=aspect
-   r.colors "$GIS_OPT_OUTPUTPREFIX.green" col=aspect
-   r.colors "$GIS_OPT_OUTPUTPREFIX.red" col=aspect
-   g.message "Fixing output names..."
-   g.rename "$GIS_OPT_OUTPUTPREFIX.green","$GIS_OPT_OUTPUTPREFIX.$TMP" --quiet
-   g.rename "$GIS_OPT_OUTPUTPREFIX.red","$GIS_OPT_OUTPUTPREFIX.green" --quiet
-   g.rename "$GIS_OPT_OUTPUTPREFIX.$TMP","$GIS_OPT_OUTPUTPREFIX.red" --quiet
-else
-   #aspect table is nice for LANDSAT and QuickBird:
-   g.message message="Assigning color tables for LANDSAT or QuickBird ...(step 4/4)"
-   r.colors "$GIS_OPT_OUTPUTPREFIX.blue" col=aspect
-   r.colors "$GIS_OPT_OUTPUTPREFIX.green" col=aspect
-   r.colors "$GIS_OPT_OUTPUTPREFIX.red" col=aspect
-fi
-
-g.message "Restoring region settings."
-cleanup
-
-g.message "Following pan-sharpened output maps have been generated:"
-echo "$GIS_OPT_OUTPUTPREFIX.red"
-echo "$GIS_OPT_OUTPUTPREFIX.green"
-echo "$GIS_OPT_OUTPUTPREFIX.blue"
-
-g.message "To visualize output, run:"
-g.message message="g.region -p rast=$GIS_OPT_OUTPUTPREFIX.red ; d.erase"
-g.message message="d.rgb r=$GIS_OPT_OUTPUTPREFIX.red g=$GIS_OPT_OUTPUTPREFIX.green b=$GIS_OPT_OUTPUTPREFIX.blue"
-g.message "If desired, combine channels with 'r.composite' to a single map."
-
-# write cmd history:
-r.support "$GIS_OPT_OUTPUTPREFIX.red" history="${CMDLINE}"
-r.support "$GIS_OPT_OUTPUTPREFIX.green" history="${CMDLINE}"
-r.support "$GIS_OPT_OUTPUTPREFIX.blue" history="${CMDLINE}"

Deleted: grass/trunk/scripts/i.image.mosaic/i.image.mosaic
===================================================================
--- grass/trunk/scripts/i.image.mosaic/i.image.mosaic	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/i.image.mosaic/i.image.mosaic	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,154 +0,0 @@
-#!/bin/sh
-# written by Markus Neteler 18. August 1998 / 20. Jan. 1999
-#            neteler geog.uni-hannover.de
-# mosaic code from Felix Gershunov (Felix spsl.nsc.ru)
-# updated for GRASS 5.7 by Michael Barton 2004/04/05
-#
-# COPYRIGHT:    (C) 1999,2007 by the GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-# TODO: - implement g.findfile for 3 and 4 maps (currently only current mapset supported)
-#            [done for 2 maps]
-#       - fix isnull() in r.mapcalc for 3 and 4 maps composites
-#            [done for 2 maps]
-#       - fix color table length (currently only 256 cols supported, make
-#         flexible)
-#            [done for 2 maps]
-#--------------------------------------------------
-
-
-#% Module
-#%  description: Mosaics up to 4 images and extends colormap; creates map *.mosaic
-#%  keywords: raster, imagery, mosaicking
-#% End
-#% option
-#% key: image1
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: 1st map for mosaic (top of image stack).
-#% required : yes
-#% end
-#% option
-#% key: image2
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: 2nd map for mosaic.
-#% required : yes
-#% end
-#% option
-#% key: image3
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: 3rd map for mosaic.
-#% required : no
-#% end
-#% option
-#% key: image4
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: 4th map for mosaic.
-#% required : no
-#% end
-
-if  [ -z "$GISBASE" ]
-then
-	echo "You must be in GRASS GIS to run this program" >&2
-	exit 1
-fi
-
-# save command line
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    CMDLINE="`basename $0`"
-    for arg in "$@" ; do
-        CMDLINE="$CMDLINE \"$arg\""
-    done
-    export CMDLINE
-    exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-#### check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message -e "awk required, please install awk or gawk first"
-    exit 1
-fi
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-   
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-CURRLOCATION=$GISDBASE/$LOCATION_NAME/$MAPSET
-
-g.message -w message='Do not forget to set region properly to cover all images!'
-
-# two images to patch
-if [ -z "$GIS_OPT_IMAGE3" -a  -z "$GIS_OPT_IMAGE4" ]; then
-     g.message "Mosaicing two images..."
-     r.mapcalc "$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.mosaic = if(isnull($GIS_OPT_IMAGE1),\
-					$GIS_OPT_IMAGE2+256,\
-					$GIS_OPT_IMAGE1)"
-     #modify the color table:
-     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"
-
-     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"
-     
-     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}"
-     exit 0
-fi
-
-# three images to patch
-if [ -z "$GIS_OPT_IMAGE3" -o  -z "$GIS_OPT_IMAGE4" ]; then
-     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"
-     g.message message="Ready. File $GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.mosaic created."
-
-     # write cmd history:
-     r.support $GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.mosaic history="${CMDLINE}"
-     exit 0
-fi
-
-# four images to patch
-if [ $GIS_OPT_IMAGE3 != "" -a  $GIS_OPT_IMAGE4 != "" ]; then
-     g.message "Mosaicing four images..."
-     r.mapcalc "$GIS_OPT_IMAGE1.$GIS_OPT_IMAGE2.$GIS_OPT_IMAGE3.$GIS_OPT_IMAGE4.mosaic = eval(t1=if($GIS_OPT_IMAGE1,$GIS_OPT_IMAGE1,$GIS_OPT_IMAGE2+256), t2=if(t1 % 256,t1,$GIS_OPT_IMAGE3+512), t3=if(t2 % 256,t2,$GIS_OPT_IMAGE4+768),t3)"
-     #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"
-     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}"
-     exit 0
-fi

Deleted: grass/trunk/scripts/i.in.spotvgt/i.in.spotvgt
===================================================================
--- grass/trunk/scripts/i.in.spotvgt/i.in.spotvgt	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/i.in.spotvgt/i.in.spotvgt	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,317 +0,0 @@
-#!/bin/sh
-
-############################################################################
-#
-# MODULE:       i.in.spot
-#
-# AUTHOR(S):    Markus Neteler
-#
-# PURPOSE:      Import SPOT VEGETATION data into a GRASS raster map
-#               SPOT Vegetation (1km, global) data:
-#               http://free.vgt.vito.be/
-#
-# COPYRIGHT:    (c) 2004-2008 GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-#############################################################################
-#
-# REQUIREMENTS:
-#      -  gdal: http://www.gdal.org
-#
-# Notes:
-# * According to the faq (http://www.vgt.vito.be/faq/faq.html), SPOT vegetation 
-#   coordinates refer to the center of a pixel.
-# * GDAL coordinates refer to the corner of a pixel
-#   -> correction of 0001/0001_LOG.TXT coordinates by 0.5 pixel
-#############################################################################
-
-#%Module
-#%  description: Import of SPOT VGT NDVI file into a raster map
-#%  keywords: raster, imagery, import
-#%End
-#%flag
-#% key: a
-#% description: also import quality map (SM status map layer) and filter NDVI map
-#%end
-#%option
-#% key: file
-#% type: string
-#% description: existing SPOT VGT NDVI HDF file (0001_NDV.HDF)
-#% gisprompt: old_file,file,input
-#% required : yes
-#%end
-#%option
-#% key: rast
-#% type: string
-#% gisprompt: new,cell,raster
-#% description: Name for output raster map
-#% required : no
-#%end
-
-
-if test "$GISBASE" = ""; then
-    echo "You must be in GRASS GIS to run this program." >&2
-    exit 1
-fi
-
-# save command line
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    CMDLINE="`basename $0`"
-    for arg in "$@" ; do
-        CMDLINE="$CMDLINE \"$arg\""
-    done
-    export CMDLINE
-    exec g.parser "$0" "$@"
-fi
-
-
-#### check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message -e "awk required, please install awk or gawk first"
-    exit 1
-fi
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION="$GISDBASE"/"$LOCATION_NAME"/"$MAPSET"
-
-
-#### check for gdalinfo (just to check if installation is complete)
-if [ ! -x "`which gdalinfo`" ] ; then
-    g.message -e "'gdalinfo' not found, install GDAL tools first (http://www.gdal.org)"
-    exit 1
-fi
-
-
-PID=$$
-TMPFILE="`g.tempfile $PID`"
-
-cleanup()
-{
-   #remove temporary region file
-   unset WIND_OVERRIDE
-   g.remove region="spot_$PID" --quiet
-   
-   #### clean up the mess
-   rm -f "$VRTFILE" "$TMPFILE"
-}
-
-# what to do in case of user break:
-exitprocedure()
-{
-   g.message -e message='User break!'
-   cleanup
-   exit 1
-}
-
-# shell check for user break (signal list: trap -l)
-trap "exitprocedure" 2 3 15
-
-
-#### a function for writing VRT files
-create_VRT_file(){
- WESTCENTER=`cat $PROJFILE  | grep CARTO_UPPER_LEFT_X  | tr -s ' ' ' ' | cut -d' ' -f2`
- NORTHCENTER=`cat $PROJFILE | grep CARTO_UPPER_LEFT_Y  | tr -s ' ' ' ' | cut -d' ' -f2`
- EASTCENTER=`cat $PROJFILE  | grep CARTO_UPPER_RIGHT_X | tr -s ' ' ' ' | cut -d' ' -f2`
- SOUTHCENTER=`cat $PROJFILE | grep CARTO_LOWER_LEFT_Y  | tr -s ' ' ' ' | cut -d' ' -f2`
- MAP_PROJ_RESOLUTION=`cat $PROJFILE | grep MAP_PROJ_RESOLUTION  | tr -s ' ' ' ' | cut -d' ' -f2`
- XSIZE=`cat $PROJFILE  | grep IMAGE_UPPER_RIGHT_COL  | tr -s ' ' ' ' | cut -d' ' -f2`
- YSIZE=`cat $PROJFILE  | grep IMAGE_LOWER_RIGHT_ROW  | tr -s ' ' ' ' | cut -d' ' -f2`
-
- # DEBUG (in terminal WEST is not printed?!?!?!)
- #echo "     $NORTHCENTER"
- #echo "       |"
- #echo -n "$WESTCENTER"
- #echo " -+- $EASTCENTER"
- #echo "       |"
- #echo "     $SOUTHCENTER"
- #echo " RES: $MAP_PROJ_RESOLUTION"
-
- WESTCORNER=`echo $WESTCENTER $MAP_PROJ_RESOLUTION | awk '{printf "%.12e", $1 - $2/2.}'`
- NORTHCORNER=`echo $NORTHCENTER $MAP_PROJ_RESOLUTION | awk '{printf "%.12e", $1 + $2/2.}'`
- EASTCORNER=`echo $EASTCENTER $MAP_PROJ_RESOLUTION | awk '{printf "%.12e", $1 + $2/2.}'`
- SOUTHCORNER=`echo $SOUTHCENTER $MAP_PROJ_RESOLUTION | awk '{printf "%.12e", $1 - $2/2.}'`
- RESOLUTION=`echo $MAP_PROJ_RESOLUTION | awk '{printf "%.12e", $1}'`
- XSIZE=`echo $XSIZE | awk '{printf "%d", $1}'`
- YSIZE=`echo $YSIZE | awk '{printf "%d", $1}'`
-
- # DEBUG 
- #echo $WESTCORNER
- #echo $NORTHCORNER
- #echo $EASTCORNER
- #echo $SOUTHCORNER
- #echo $RESOLUTION
-
- echo "<VRTDataset rasterXSize=\"$XSIZE\" rasterYSize=\"$YSIZE\">" >> "$1"
- echo " <SRS>GEOGCS[&quot;wgs84&quot;,DATUM[&quot;WGS_1984&quot;,SPHEROID[&quot;wgs84&quot;,6378137,298.257223563],TOWGS84[0.000,0.000,0.000]],PRIMEM[&quot;Greenwich&quot;,0],UNIT[&quot;degree&quot;,0.0174532925199433]]</SRS>" >> "$1"
- echo "   <GeoTransform>$WESTCORNER, $RESOLUTION, 0.0000000000000000e+00, $NORTHCORNER, 0.0000000000000e+00, -$RESOLUTION</GeoTransform>" >> "$1"
- echo "   <VRTRasterBand dataType=\"Byte\" band=\"1\">" >> "$1"
- echo "    <NoDataValue>0.00000000000000E+00</NoDataValue>" >> "$1"
- echo "    <ColorInterp>Gray</ColorInterp>" >> "$1"
- echo "    <SimpleSource>" >> "$1"
- echo "     <SourceFilename>$2</SourceFilename>" >> "$1"
- echo "      <SourceBand>1</SourceBand>" >> "$1"
- echo "      <SrcRect xOff=\"0\" yOff=\"0\" xSize=\"$XSIZE\" ySize=\"$YSIZE\"/>" >> "$1"
- echo "      <DstRect xOff=\"0\" yOff=\"0\" xSize=\"$XSIZE\" ySize=\"$YSIZE\"/>" >> "$1"
- echo "    </SimpleSource>" >> "$1"
- echo " </VRTRasterBand>" >> "$1"
- echo "</VRTDataset>" >> "$1"
-}
-
-
-################### let's go
-
-if [ -n "$GIS_OPT_FILE" ] ; then
-    SPOTDIR="`dirname $GIS_OPT_FILE`"
-    SPOTNAME=`basename $GIS_OPT_FILE .HDF`
-fi
-
-if [ -n "$GIS_OPT_RAST" ] ; then
-    NAME="$GIS_OPT_RAST"
-else
-    NAME="$SPOTNAME"
-fi
-
-if [ -n `g.findfile elem=cell file="$NAME" | grep ^file | cut -f2 -d=` ] ; then
-	g.message -e message="<$NAME> already exists. Aborting."
-	exit 1
-fi
-
-# still a ZIP file?  (is this portable?? see the r.in.srtm script for ideas)
-if [ "`file -ib $GIS_OPT_FILE`" = "application/x-zip" ] ; then
-  g.message -e message="Please extract $GIS_OPT_FILE before import."
-  exit 1
-fi
-
-
-### create VRT header for NDVI
-
-PROJFILE="${SPOTDIR}/0001_LOG.TXT"
-VRTFILE="$TMPFILE.vrt"
-
-# first process the NDVI:
-rm -f "$VRTFILE"
-create_VRT_file "$VRTFILE" "$GIS_OPT_FILE"
-
-## let's import the NDVI map...
-g.message "Importing SPOT VGT NDVI map..."
-r.in.gdal "$VRTFILE" output="$NAME"
-if [ $? -eq 1 ] ; then
-   g.message -e "An error occurred. Stop."
-   cleanup
-   exit 1
-fi
-
-g.message message="Imported SPOT VEGETATION NDVI map <$NAME>."
-
-#################
-## http://www.vgt.vito.be/faq/FAQS/faq19.html
-# What is the relation between the digital number and the real NDVI ?
-# Real NDVI =coefficient a * Digital Number + coefficient b
-#           = a * DN +b
-#
-# Coefficient a = 0.004
-# Coefficient b = -0.1
-
-
-# clone current region
-g.region save="spot_$PID"
-
-# switch to a temporary region
-WIND_OVERRIDE="spot_$PID"
-export WIND_OVERRIDE
-
-g.region rast="$NAME" --quiet
-
-g.message "Remapping digital numbers to NDVI..."
-r.mapcalc "${NAME}_$PID = 0.004 * $NAME - 0.1"
-g.remove rast="$NAME" --quiet
-g.rename rast="${NAME}_$PID","$NAME" --quiet
-
-#apply color table:
-r.colors "$NAME" color=ndvi --quiet
-
-##########################
-# second, optionally process the SM quality map:
-
-#SM Status Map
-# http://www.vgt.vito.be/faq/FAQS/faq15.html
-#Data about
-# Bit NR 7: Radiometric quality for B0 coded as 0 if bad and 1 if good
-# Bit NR 6: Radiometric quality for B2 coded as 0 if bad and 1 if good
-# Bit NR 5: Radiometric quality for B3 coded as 0 if bad and 1 if good
-# Bit NR 4: Radiometric quality for MIR coded as 0 if bad and 1 if good
-# Bit NR 3: land code 1 or water code 0
-# Bit NR 2: ice/snow code 1 , code 0 if there is no ice/snow
-# Bit NR 1:	0	0	1		1
-# Bit NR 0:	0	1	0		1
-# 		clear	shadow	uncertain	cloud
-#
-#Note:
-# pos 7     6    5    4    3    2   1   0 (bit position)
-#   128    64   32   16    8    4   2   1 (values for 8 bit)
-#
-#
-# Bit 4-7 should be 1: their sum is 240
-# Bit 3   land code, should be 1, sum up to 248 along with higher bits
-# Bit 2   ice/snow code
-# Bit 0-1 should be 0
-#
-# A good map threshold: >= 248
-
-if [ $GIS_FLAG_A -eq 1 ] ; then
-  g.message "Importing SPOT VGT NDVI quality map..."
-  rm -f "$VRTFILE"
-  create_VRT_file "$VRTFILE" `echo ${GIS_OPT_FILE} | sed 's+NDV+SM+g'`
-
-  ## let's import the SM quality map...
-  r.in.gdal "$VRTFILE" output="$NAME.sm"
-  if [ $? -eq 1 ] ; then
-     g.message -e "An error occurred. Stop."
-     cleanup
-     exit 1
-  fi
-
-# some of the possible values:
-r.colors "$NAME.sm" col=rules << EOF
-8 50 50 50
-11 70 70 70
-12 90 90 90
-60 grey
-155 blue
-232 violet
-235 red
-236 brown
-248 orange
-251 yellow
-252 green
-EOF
-
-  g.message message="Imported SPOT VEGETATION SM quality map <$NAME.sm>."
-  g.message message="Note: A snow map can be extracted by category 252 (d.rast $NAME.sm cat=252)"
-  g.message ""
-  g.message message="Filtering NDVI map by Status Map quality layer..."
-  r.mapcalc "${NAME}_filt=if($NAME.sm >= 248, $NAME, null() )"
-  r.colors "${NAME}_filt" color=ndvi --quiet
-  g.message message="Filtered SPOT VEGETATION NDVI map <${NAME}_filt>."
-fi
-
-
-# remove the temporary region and files
-cleanup
-
-# write cmd history:
-r.support "$NAME" history="${CMDLINE}"
-
-g.message "Done."
-
-exit 0
-

Deleted: grass/trunk/scripts/i.landsat.rgb/i.landsat.rgb
===================================================================
--- grass/trunk/scripts/i.landsat.rgb/i.landsat.rgb	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/i.landsat.rgb/i.landsat.rgb	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,163 +0,0 @@
-#!/bin/sh
-
-############################################################################
-#
-# MODULE:	i.landsat.rgb
-#
-# AUTHOR(S):	Markus Neteler. <neteler itc it>
-#		Hamish Bowman, scripting enhancements
-#
-# PURPOSE:      create pretty LANDSAT RGBs: the trick is to remove outliers 
-#               using percentiles (area under the histogram curve)
-#
-# COPYRIGHT:	(C) 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-# TODO: implement better brightness control
-#############################################################################
-
-#%Module
-#%  description: Auto-balancing of colors for LANDSAT images
-#%  keywords: raster, imagery, colors
-#%End
-#%option
-#% key: red
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: LANDSAT red channel
-#% required : yes
-#%end
-#%option
-#% key: green
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: LANDSAT green channel
-#% required : yes
-#%end
-#%option
-#% key: blue
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: LANDSAT blue channel
-#% required : yes
-#%end
-#%option
-#% key: strength
-#% type: integer
-#% description: Cropping intensity (upper brightness level)
-#% options: 0-100
-#% answer : 98
-#% required : no
-#%end
-#%flag
-#% key: f
-#% description: Extend colors to full range of data on each channel
-#%end
-#%flag
-#% key: p
-#% description: Preserve relative colors, adjust brightness only
-#%end
-#%flag
-#% key: r
-#% description: Reset to standard color range
-#%end
-
-
-if [ -z "$GISBASE" ] ; then
- echo "You must be in GRASS GIS to run this program." >&2
- exit 1
-fi
-
-# save command line
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    CMDLINE="`basename $0`"
-    for arg in "$@" ; do
-        CMDLINE="$CMDLINE \"$arg\""
-    done
-    export CMDLINE
-    exec g.parser "$0" "$@"
-fi
-
-# check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message -e "awk required, please install awk or gawk first"
-    exit 1
-fi 
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-PROG=`basename $0`
-
-BLUE="$GIS_OPT_BLUE"
-GREEN="$GIS_OPT_GREEN"
-RED="$GIS_OPT_RED"
-
-# 90 or 98? MAX value controls brightness
-# think of percent (0-100), must be positive or 0
-# must be more than "2" ?
-BRIGHTNESS="$GIS_OPT_STRENGTH"
-
-
-if [ 1 -eq $GIS_FLAG_F ] ; then
-   for i in $RED $GREEN $BLUE ; do
-      r.colors $i col=grey
-   done
-   exit 0
-fi
-if [ 1 -eq $GIS_FLAG_R ] ; then
-   for i in $RED $GREEN $BLUE ; do
-      r.colors $i col=rules << EOF
-	0 black
-	255 white
-EOF
-   done
-   exit 0
-fi
-
-if [ 0 -eq $GIS_FLAG_P ] ; then
-   for i in $RED $GREEN $BLUE ; do
-      g.message "Processing <$i> ..."
-      MIN=`r.univar -ge $i perc=2 | grep "^percentile_" | cut -d'=' -f2`
-      MAX=`r.univar -ge $i perc=$BRIGHTNESS | grep "^percentile_" | cut -d'=' -f2`
-      g.message -d message="<$i>:  min=$MIN   max=$MAX"
-      r.colors $i col=rules << EOF
-	0% black
-	$MIN black
-	$MAX white
-	100% white
-EOF
-      done
-else
-   ALL_MAX=0
-   ALL_MIN=255
-   for i in $RED $GREEN $BLUE ; do
-      g.message "Processing <$i> ..."
-      MIN=`r.univar -ge $i perc=2  | grep "^percentile_" | cut -d'=' -f2`
-      MAX=`r.univar -ge $i perc=$BRIGHTNESS | grep "^percentile_" | cut -d'=' -f2`
-      g.message -d message="<$i>:  min=$MIN   max=$MAX"
-      ALL_MAX=`echo "$MAX $ALL_MAX" | awk '{if ($1 > $2) print $1; else print $2}'`
-      ALL_MIN=`echo "$MIN $ALL_MIN" | awk '{if ($1 < $2) print $1; else print $2}'` 
-   done
-   g.message -d message="all_min=$ALL_MIN   all_max=$ALL_MAX"
-   for i in $RED $GREEN $BLUE ; do
-      r.colors $i col=rules << EOF
-	0% black
-	$ALL_MIN black
-	$ALL_MAX white
-	100% white
-EOF
-   done
-fi
-
-# write cmd history:
-r.support ${GIS_OPT_BLUE} history="${CMDLINE}"
-r.support ${GIS_OPT_GREEN} history="${CMDLINE}"
-r.support ${GIS_OPT_RED} history="${CMDLINE}"
-
-exit 0

Deleted: grass/trunk/scripts/i.oif/i.oif
===================================================================
--- grass/trunk/scripts/i.oif/i.oif	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/i.oif/i.oif	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,221 +0,0 @@
-#!/bin/sh
-
-############################################################################
-#
-# MODULE:       i.oif
-# AUTHOR(S):    Markus Neteler
-# PURPOSE:      calculates the Optimum Index factor of all band combinations
-#               for LANDSAT TM 1,2,3,4,5,7
-# COPYRIGHT:    (C) 1999 by the GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-#############################################################################
-# Ref.: Jensen: Introductory digital image processing 1996, p.98
-#
-# Input: tm1 - tm5, tm7 (not tm6)
-#
-# written by Markus Neteler 21.July 1998
-#            neteler geog.uni-hannover.de
-# updated for GRASS 5.7 by Michael Barton 2004/04/05
-
-
-#% Module
-#%  description: Calculates Optimum-Index-Factor table for LANDSAT TM bands 1-5, & 7
-#%  keywords: raster, imagery, statistics
-#% End
-#% option
-#% key: image1
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: LANDSAT TM band 1.
-#% required : yes
-#% end
-#% option
-#% key: image2
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: LANDSAT TM band 2.
-#% required : yes
-#% end
-#% option
-#% key: image3
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: LANDSAT TM band 3.
-#% required : yes
-#% end
-#% option
-#% key: image4
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: LANDSAT TM band 4.
-#% required : yes
-#% end
-#% option
-#% key: image5
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: LANDSAT TM band 5.
-#% required : yes
-#% end
-#% option
-#% key: image7
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: LANDSAT TM band 7.
-#% required : yes
-#% end
-#% Flag
-#% key: g
-#% description: Print in shell script style
-#% End
-
-if  [ -z "$GISBASE" ]
-then
-	echo "You must be in GRASS GIS to run this program" >&2
-	exit 1
-fi
-
-if   [ "$1" != "@ARGS_PARSED@" ]
-then
-	exec g.parser "$0" "$@"
-fi
-
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION=$GISDBASE/$LOCATION_NAME/$MAPSET
-
-# Open tempfiles
-temp_stddev="`g.tempfile $$`"
-export temp_stddev
-temp_correlation="`g.tempfile $$`"
-export temp_correlation
-temp_sum="`g.tempfile $$`"
-export temp_sum
-temp_calc="`g.tempfile $$`"
-export temp_calc
-temp_result="`g.tempfile $$`"
-temp_result2="`g.tempfile $$`"
-temp_bands="`g.tempfile $$`"
-
-# save the Stddev for TM bands
-g.message "Calculating Standard deviations for all bands:"
-g.message "band 1"
-r.univar -g "$GIS_OPT_IMAGE1" | grep stddev | cut -f2 -d= > "$temp_stddev"
-g.message "band 2"
-r.univar -g "$GIS_OPT_IMAGE2" | grep stddev | cut -f2 -d= >> "$temp_stddev"
-g.message "band 3"
-r.univar -g "$GIS_OPT_IMAGE3" | grep stddev | cut -f2 -d= >> "$temp_stddev"
-g.message "band 4"
-r.univar -g "$GIS_OPT_IMAGE4" | grep stddev | cut -f2 -d= >> "$temp_stddev"
-g.message "band 5"
-r.univar -g "$GIS_OPT_IMAGE5" | grep stddev | cut -f2 -d= >> "$temp_stddev"
-g.message "band 7"
-r.univar -g "$GIS_OPT_IMAGE7" | grep stddev | cut -f2 -d= >> "$temp_stddev"
-
-g.message "Calculating Correlation Matrix"
-r.covar -r map=$GIS_OPT_IMAGE1,$GIS_OPT_IMAGE2,$GIS_OPT_IMAGE3,$GIS_OPT_IMAGE4,$GIS_OPT_IMAGE5,$GIS_OPT_IMAGE7 |tail -6 > "$temp_correlation"
-
-# Calculate all combinations
-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"
-
-g.message "Calculate OIF for combination 124"
-echo "124: " >> "$temp_bands"
-"$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"
-
-g.message "Calculate OIF for combination 127"   
-echo "127: " >> "$temp_bands"
-"$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"
-
-g.message "Calculate OIF for combination 135"   
-echo "135: " >> "$temp_bands"
-"$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"
-
-g.message "Calculate OIF for combination 145"   
-echo "145: " >> "$temp_bands"
-"$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"
-
-g.message "Calculate OIF for combination 157"   
-echo "157: " >> "$temp_bands"
-"$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"
-
-g.message "Calculate OIF for combination 235"   
-echo "235: " >> "$temp_bands"
-"$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"
-
-g.message "Calculate OIF for combination 245"   
-echo "245: " >> "$temp_bands"
-"$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"
-
-g.message "Calculate OIF for combination 257"   
-echo "257: " >> "$temp_bands"
-"$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"
-
-g.message "Calculate OIF for combination 347"   
-echo "347: " >> "$temp_bands"
-"$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"
-
-g.message "Calculate OIF for combination 457"   
-echo "457: " >> "$temp_bands"
-"$GISBASE"/etc/i.oif/i.oifcalc 4 5 7 >> "$temp_result"
-
-paste -d' ' "$temp_bands" "$temp_result" > "$temp_result2"
-g.message "Ready."
-g.message "The Optimum Index Factor analysis result:"
-g.message "    (Best combination comes first.)"
-
-if [ $GIS_FLAG_G -eq 1 ] ; then
-   sort -k 2 -n -r "$temp_result2" | tee ./i.oif.result | sed 's+:  +:+g'
-else
-   sort -k 2 -n -r "$temp_result2" | tee ./i.oif.result
-fi
-
-rm -f "$temp_stddev"
-rm -f "$temp_correlation"
-rm -f "$temp_sum"
-rm -f "$temp_calc"
-rm -f "$temp_result"
-rm -f "$temp_result2"
-rm -f "$temp_bands"

Deleted: grass/trunk/scripts/i.spectral/i.spectral
===================================================================
--- grass/trunk/scripts/i.spectral/i.spectral	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/i.spectral/i.spectral	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,291 +0,0 @@
-#!/bin/bash
-
-############################################################################
-#
-# MODULE:       i.spectral
-# AUTHOR(S):    Markus Neteler, 18. August 1998
-# PURPOSE:      displays spectral response at user specified locations in group or images
-# COPYRIGHT:    (C) 1999 by the GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-#############################################################################
-
-# written by Markus Neteler 18. August 1998
-#            neteler geog.uni-hannover.de
-# 
-# bugfix: 25. Nov.98/20. Jan. 1999
-# 3 March 2006: Added multiple images and group support by Francesco Pirotti - CIRGEO
-# this script needs gnuplot
-
-#%Module
-#%  description: displays spectral response at user specified locations in group or images
-#%  keywords: imagery, raster, multispectral
-#%End
-#%option
-#% key: group
-#% type: string
-#% gisprompt: old,group
-#% description: group input
-#% required : no
-#%end
-#%option
-#% key: raster
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: raster input maps
-#% multiple : yes
-#% required : no
-#%end
-#%option
-#% key: output
-#% type: string
-#% gisprompt: output
-#% description: write output to PNG image
-#% multiple : no
-#% required : no
-#%end
-#%flag 
-#%key: i
-#%description: Use image list and not group
-#%end
-#%flag 
-#%key: m
-#%description: Select multiple points
-#%end
-#%flag 
-#%key: c
-#%description: label with coordinates instead of numbering
-#%end
-
-if test "$GISBASE" = ""; then
- echo "You must be in GRASS GIS to run this program." >&2
- exit 1
-fi
-
-PARAM_NUM=$#
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-  exec g.parser "$0" "$@"
-fi
-
-#check if present
-if [ ! -x "`which gnuplot`" ] ; then
-    g.message -e "gnuplot required, please install first"
-    exit 1
-fi
-
-#### check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message -e "awk required, please install awk or gawk first"
-    exit 1
-fi
-
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-TMP1="`g.tempfile pid=$$`"
-TMP2="`g.tempfile pid=$$`"
-
-# get y-data for gnuplot-data file
-# get data from group files and set the x-axis labels
-
-xlabels=""
-
-if [ ! "$GIS_OPT_GROUP" ] ; then
-   if [ $GIS_FLAG_I -eq 0 ] ; then
-      g.message -e "Please use -i if you don't use the 'group' parameter"
-      exit 1
-   fi
-fi
-
-if [ $GIS_FLAG_I -eq 0 ] ; then
-
-	# ## PARSES THE GROUP FILES - gets rid of ugly header info from group list output
-	i.group  group=$GIS_OPT_GROUP -l | sed 's+ in + +g' | grep "group" -v | grep "\-\-\-\-$" -v > "$TMP2"
-	as=0
-	lists=""
-	xlabels=""
-	ass=0
-	for i in $( cat "$TMP2" ); do
-		er=`expr $as % 2`
-		as=`expr $as + 1`
-		if [ "$er" -eq "0" ]; then
-			ass=`expr $ass + 1`
-			if [ "$as" -eq "1" ]; then
-  	                  lists=$i
-			  xlabels="'$i' 1"
-			else
-   	                  lists=$lists,$i
-			  xlabels="$xlabels, '$i' $ass"
-		        fi
- 		fi       
-	 done
-
-NUMBANDS=$ass
-RASTERMAPS="$lists"
-
-# ## get data from list of files and set the x-axis labels
-else
-  RASTERMAPS="$GIS_OPT_RASTER"
-  news=`echo $GIS_OPT_RASTER | sed 's+,+ +g'`
-  as=0
-  for g in $news; do 
-    as=`expr $as + 1`
-    if [ "$as" -eq "1" ]; then
-       xlabels="'$g' $as"
-    else
-       xlabels="$xlabels, '$g' $as"
-    fi
-   done
-
-   NUMBANDS=$as
-fi
-
-rm -f "$TMP2"
-
-#RASTERMAPS=`echo $RASTERMAPS | sed 's+ $++g' | sed 's+ +,+g'`
-
-if [ "$GIS_FLAG_M" -eq "0" ]; then
-  if [ `d.mon -L | grep -v 'not running' | wc -l | awk '{print $1}'` -eq 2 ] ; then
-	  g.message -e "No graphic device open (d.mon)"
-	  exit 1
-  fi
-  d.where -1 | r.what input=$RASTERMAPS > "$TMP1"
-else 
-  asss=0
-  if [ `d.mon -L | grep -v 'not running' | wc -l | awk '{print $1}'` -eq 2 ] ; then
-	  g.message -e  "No graphic device open (d.mon)"
-	  exit 1
-  fi
-  d.where | r.what input=$RASTERMAPS > "$TMP1"
-  cat "$TMP1" > tmper
-  rm -f "$TMP1"
-  for asas in $(cat "tmper"); do
-    asss=`expr $asss + 1`
-    echo $asas | sed 's+||+|'$asss'|+g' >> "$TMP1"
-  done
-fi
-
-cc=0
-
-TT="`cat "$TMP1" | sed 's+\*+0+g' | sed 's+|+ +g'`"
-
-NUMCLICKS="`cat "$TMP1" | wc -l`"
-START=0
-
-# tell data to outpu in different files to accept multiple plots - cache coordinates for output
-for hell in $( cat "$TMP1"); do
-   START=`expr $START + 1`
-   #cc=`expr $cc + 1`
-   COORD[$START]="`echo $hell | cut -d'|' -f1,2 | tr '|' ' '`"
-   #LABELS[$START]="`cat "$TMP1" | cut -d'|' -f3 `"
-   TOT="`echo $hell | sed 's+\*+0+g' | sed 's+|+ +g'`"
-   cc=0
-   for ix in $TOT; do
-    cc=`expr $cc + 1`
-    if [ "$cc" -gt 3 ]; then
-      echo $ix >> "$TMP2"_$START
-    fi
-   done
-
-done
-
-rm -f "$TMP1"
-
-NUM=$NUMBANDS
-#echo $NUM
-#echo $NUMCLICKS RRRRRRRRRRRR
-NUM2=`expr $NUM / $NUMCLICKS`
-NUM2=`expr $NUM2 + 1`
-
-
-# build data file
-# the x-axis... depending on number of bands
-rm -f data.dum
-
-  i=0
-  while [ $i != $NUMBANDS ]
-   do
-    i=`expr $i + 1`
-    echo $i >> data.dum
-   done 
-
-r=0
-while [ $r != $NUMCLICKS ]
-do
-  r=`expr $r + 1`
-  paste -d' ' data.dum "$TMP2"_$r > data_$r
-  rm -f "$TMP2"_$r
-done
-
-# paste to data file
-#paste -d' ' data.dum "$TMP2" > data
-xrange=`expr $NUMBANDS + 1`
-
-# build gnuplot script
-if [ -n "$GIS_OPT_OUTPUT" ] ; then
-  echo "set term png large" >> spectrum.gnuplot
-  echo "set output '$GIS_OPT_OUTPUT'" >> spectrum.gnuplot
-fi
-echo "set xtics ($xlabels)" >> spectrum.gnuplot
-echo "set grid" >> spectrum.gnuplot
-echo "set title 'Spectral signatures'" >> spectrum.gnuplot
-##echo "set yrange [0:255]" >> spectrum.gnuplot
-echo "set xrange [0:$xrange]" >> spectrum.gnuplot
-echo "set noclabel" >> spectrum.gnuplot
-echo "set xlabel 'Bands'" >> spectrum.gnuplot
-echo "set ylabel 'DN Value'" >> spectrum.gnuplot
-
-## if more then 2 points we can draw an interpolated spline:
-#if [ $PARAM_NUM -gt 2 ]
-#then
-#   echo "set data style linespoints" >> spectrum.gnuplot
-#   echo "plot 'data' with points pt 779, '' smooth csplines t 'spline interpolated'" >> spectrum.gnuplot
-#else
-   echo "set data style lines" >> spectrum.gnuplot
-  
-
- rm -f data.dum
-
- i=0
-str=""
-  while [ $i != $NUMCLICKS ]
-   do
-    i=`expr $i + 1`
-    if [ "$i" -eq "1" ]
-     then
-      if [ $GIS_FLAG_C -eq 0 ] ; then
-        str="plot 'data_$i' title '$i'" 
-      else
-        str="plot 'data_$i' title '${COORD[$i]}'" 
-      fi
-     else
-      if [ $GIS_FLAG_C -eq 0 ] ; then
-        str=$str",'data_$i' title '$i'" 
-      else
-        str=$str",'data_$i' title '${COORD[$i]}'" 
-      fi
-     fi
-
-   done 
-str=$str" with linespoints pt 779"
-echo $str >> spectrum.gnuplot
-
-
-$GRASS_GNUPLOT spectrum.gnuplot 
- 
-
-i=0
-while [ $i != $NUMCLICKS ]
-   do
- i=`expr $i + 1`
- rm -f data_$i
-done
-
-rm -f spectrum.gnuplot

Deleted: grass/trunk/scripts/i.tasscap/i.tasscap
===================================================================
--- grass/trunk/scripts/i.tasscap/i.tasscap	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/i.tasscap/i.tasscap	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,161 +0,0 @@
-#!/bin/sh
-#
-############################################################################
-#
-# MODULE:	i.tasscap
-# AUTHOR(S):	Markus Neteler. neteler itc.it
-# PURPOSE:	At-satellite reflectance based tasseled cap transformation.
-# COPYRIGHT:	(C) 1997-2004 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-# TODO: Check if MODIS Tasseled Cap makes sense to be added
-#       http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=1025776
-#############################################################################
-# References:
-# LANDSAT-4/LANDSAT-5:
-#  script based on i.tasscap.tm4 from Dr. Agustin Lobo - alobo at ija.csic.es
-#  TC-factor changed to CRIST et al. 1986, p.1467 (Markus Neteler 1/99)
-#                       Proc. IGARSS 1986
-#
-# LANDSAT-7:
-#  TASSCAP factors cited from:
-#   DERIVATION OF A TASSELED CAP TRANSFORMATION BASED ON LANDSAT 7 AT-SATELLITE REFLECTANCE
-#   Chengquan Huang, Bruce Wylie, Limin Yang, Collin Homer and Gregory Zylstra Raytheon ITSS, 
-#   USGS EROS Data Center Sioux Falls, SD 57198, USA
-#   http://landcover.usgs.gov/pdf/tasseled.pdf
-#
-#  This is published as well in INT. J. OF RS, 2002, VOL 23, NO. 8, 1741-1748.
-#  Compare discussion:
-#  http://adis.cesnet.cz/cgi-bin/lwgate/IMAGRS-L/archives/imagrs-l.log0211/date/article-14.html
-#############################################################################
-#
-#%Module
-#%  description: Tasseled Cap (Kauth Thomas) transformation for LANDSAT-TM data
-#%  keywords: raster, imagery
-#%End
-#%flag
-#%  key: 4
-#%  description: use transformation rules for LANDSAT-4
-#%END
-#%flag
-#%  key: 5
-#%  description: use transformation rules for LANDSAT-5
-#%END
-#%flag
-#%  key: 7
-#%  description: use transformation rules for LANDSAT-7
-#%END
-#%option
-#% key: band1
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: raster input map (LANDSAT channel 1)
-#% required : yes
-#%end
-#%option
-#% key: band2
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: raster input map (LANDSAT channel 2)
-#% required : yes
-#%end
-#%option
-#% key: band3
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: raster input map (LANDSAT channel 3)
-#% required : yes
-#%end
-#%option
-#% key: band4
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: raster input map (LANDSAT channel 4)
-#% required : yes
-#%end
-#%option
-#% key: band5
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: raster input map (LANDSAT channel 5)
-#% required : yes
-#%end
-#%option
-#% key: band7
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: raster input map (LANDSAT channel 7)
-#% required : yes
-#%end
-#%option
-#% key: outprefix
-#% type: string
-#% gisprompt: new,cell,raster
-#% description: raster output TC maps prefix
-#% required : yes
-#%end
-
-if test "$GISBASE" = ""; then
- echo "You must be in GRASS GIS to run this program." >&2
- exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-  exec g.parser "$0" "$@"
-fi
-
-if [ $GIS_FLAG_4 -eq 1 ] ; then
-  g.message "LANDSAT-4..."
-  g.message "Calculating first TC component $GIS_OPT_OUTPREFIX.1 ..."
-  r.mapcalc "$GIS_OPT_OUTPREFIX.1 =  0.3037 * $GIS_OPT_BAND1 + 0.2793 * $GIS_OPT_BAND2 + 0.4743 * $GIS_OPT_BAND3 + 0.5585 * $GIS_OPT_BAND4 + 0.5082 * $GIS_OPT_BAND5 + 0.1863 * $GIS_OPT_BAND7"
-  
-  g.message "Calculating second TC component $GIS_OPT_OUTPREFIX.2 ..."
-  r.mapcalc "$GIS_OPT_OUTPREFIX.2 = -0.2848 * $GIS_OPT_BAND1 - 0.2435 * $GIS_OPT_BAND2 - 0.5435 * $GIS_OPT_BAND3 + 0.7243 * $GIS_OPT_BAND4 + 0.0840 * $GIS_OPT_BAND5 - 0.1800 * $GIS_OPT_BAND7"
-  
-  g.message "Calculating third TC component $GIS_OPT_OUTPREFIX.3 ..."
-  r.mapcalc "$GIS_OPT_OUTPREFIX.3 =  0.1509 * $GIS_OPT_BAND1 + 0.1973 * $GIS_OPT_BAND2 + 0.3279 * $GIS_OPT_BAND3 + 0.3406 * $GIS_OPT_BAND4 - 0.7112 * $GIS_OPT_BAND5 - 0.4572 * $GIS_OPT_BAND7"
-else
- if [ $GIS_FLAG_5 -eq 1 ] ; then
-  g.message "LANDSAT-5..."
-  g.message "Calculating first TC component $GIS_OPT_OUTPREFIX.1 (Brightness) ..."
-  r.mapcalc "$GIS_OPT_OUTPREFIX.1 = 0.2909 * $GIS_OPT_BAND1 + 0.2493 * $GIS_OPT_BAND2 + 0.4806 * $GIS_OPT_BAND3 + 0.5568 * $GIS_OPT_BAND4 + 0.4438 * $GIS_OPT_BAND5 + 0.1706 * $GIS_OPT_BAND7 + 10.3695"
-  
-  g.message "Calculating second TC component $GIS_OPT_OUTPREFIX.2 (Greenness) ..."
-  r.mapcalc "$GIS_OPT_OUTPREFIX.2 = -0.2728 * $GIS_OPT_BAND1 - 0.2174 * $GIS_OPT_BAND2 - 0.5508 * $GIS_OPT_BAND3 + 0.7221 * $GIS_OPT_BAND4 + 0.0733 * $GIS_OPT_BAND5 - 0.1648 * $GIS_OPT_BAND7 - 0.7310"
-  
-  g.message "Calculating third TC component $GIS_OPT_OUTPREFIX.3 (Wetness) ..."
-  r.mapcalc "$GIS_OPT_OUTPREFIX.3 = 0.1446 * $GIS_OPT_BAND1 + 0.1761 * $GIS_OPT_BAND2 + 0.3322 * $GIS_OPT_BAND3 + 0.3396 * $GIS_OPT_BAND4 - 0.6210 * $GIS_OPT_BAND5 - 0.4186 * $GIS_OPT_BAND7 - 3.3828"
-  
-  g.message "Calculating fourth TC component $GIS_OPT_OUTPREFIX.4. (Haze) ..."
-  r.mapcalc "$GIS_OPT_OUTPREFIX.4 = 0.8461 * $GIS_OPT_BAND1 - 0.0731 * $GIS_OPT_BAND2 - 0.4640 * $GIS_OPT_BAND3 - 0.0032 * $GIS_OPT_BAND4 - 0.0492 * $GIS_OPT_BAND5 - 0.0119 * $GIS_OPT_BAND7 + 0.7879"
- else
-  if [ $GIS_FLAG_7 -eq 1 ] ; then
-   g.message "LANDSAT-7..."
-   g.message "Calculating first TC component $GIS_OPT_OUTPREFIX.1 (Brightness) ..."
-   r.mapcalc "$GIS_OPT_OUTPREFIX.1 = 0.3561 * $GIS_OPT_BAND1 + 0.3972 * $GIS_OPT_BAND2 + 0.3904 * $GIS_OPT_BAND3 + 0.6966 * $GIS_OPT_BAND4 + 0.2286 * $GIS_OPT_BAND5 + 0.1596 * $GIS_OPT_BAND7"
-   
-   g.message "Calculating second TC component $GIS_OPT_OUTPREFIX.2 (Greenness) ..."
-   r.mapcalc "$GIS_OPT_OUTPREFIX.2 = -0.3344 * $GIS_OPT_BAND1 - 0.3544 * $GIS_OPT_BAND2 - 0.4556 * $GIS_OPT_BAND3 + 0.6966 * $GIS_OPT_BAND4 - 0.0242 * $GIS_OPT_BAND5 - 0.2630 *  $GIS_OPT_BAND7"
-   
-   g.message "Calculating third TC component $GIS_OPT_OUTPREFIX.3 (Wetness) ..."
-   r.mapcalc "$GIS_OPT_OUTPREFIX.3 = 0.2626 * $GIS_OPT_BAND1 + 0.2141 * $GIS_OPT_BAND2 + 0.0926 * $GIS_OPT_BAND3 + 0.0656 * $GIS_OPT_BAND4 - 0.7629 * $GIS_OPT_BAND5 - 0.5388 * $GIS_OPT_BAND7"
-   
-   g.message "Calculating fourth TC component $GIS_OPT_OUTPREFIX.4. (Haze) ..."
-   r.mapcalc "$GIS_OPT_OUTPREFIX.4 = 0.0805 * $GIS_OPT_BAND1 - 0.0498 * $GIS_OPT_BAND2 + 0.1950 * $GIS_OPT_BAND3 - 0.1327 * $GIS_OPT_BAND4 + 0.5752 * $GIS_OPT_BAND5 - 0.7775 * $GIS_OPT_BAND7"
-  else
-   g.message -e 'Select LANDSAT satellite by flag!'
-   exit 1
-  fi
- fi
-fi
-
-r.colors map=$GIS_OPT_OUTPREFIX.1 color=grey
-r.colors map=$GIS_OPT_OUTPREFIX.2 color=grey
-r.colors map=$GIS_OPT_OUTPREFIX.3 color=grey
-if [ $GIS_FLAG_4 -ne 1 ] ; then
- r.colors map=$GIS_OPT_OUTPREFIX.4 color=grey
-fi
-
-g.message "Tasseled Cap components calculated."

Deleted: grass/trunk/scripts/m.proj/m.proj
===================================================================
--- grass/trunk/scripts/m.proj/m.proj	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/m.proj/m.proj	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,251 +0,0 @@
-#!/bin/sh
-
-############################################################################
-#
-# MODULE:	m.proj
-# AUTHOR:	M. Hamish Bowman, Dept. Marine Science, Otago Univeristy,
-#		  New Zealand
-# PURPOSE:      cs2cs reprojection frontend for a list of coordinates.
-#		Replacement for m.proj2 from GRASS 5
-# COPYRIGHT:	(c) 2006 Hamish Bowman, and the GRASS Development Team
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-#############################################################################
-
-# notes:
-#  - cs2cs expects "x y" data so be sure to send it "lon lat" not "lat lon"
-#  - if you send cs2cs a third data column, beware it might be treated as "z"
-
-#%Module
-#%  description: Convert coordinates from one projection to another (cs2cs frontend).
-#%  keywords: miscellaneous, projection
-#%End
-#%option
-#% key: input
-#% type: string
-#% gisprompt: old_file,file,file
-#% description: Input coordinate file (omit to read from stdin)
-#% required : no
-#% key_desc : filename
-#%end
-#%option
-#% key: output
-#% type: string
-#% gisprompt: new_file,file,file
-#% description: Output coordinate file (omit to send to stdout)
-#% required : no
-#% key_desc : filename
-#%end
-#%option
-#% key: fs
-#% type: string
-#% description: Field separator
-#% required : no
-#% key_desc : character
-#% answer : |
-#%end
-#%option
-#% key: proj_in
-#% type: string
-#% description: Input projection parameters (PROJ.4 style)
-#% required : no
-#%end
-#%option
-#% key: proj_out
-#% type: string
-#% description: Output projection parameters (PROJ.4 style)
-#% required : no
-#%end
-#%flag
-#% key: i
-#% description: Use LL WGS84 as input and current location as output projection
-#%end
-#%flag
-#% key: o
-#% description: Use current location as input and LL WGS84 as output projection
-#%end
-#%flag
-#% key: d
-#% description: Output long/lat in decimal degrees or other projections with many decimal places
-#%end
-#%flag
-#% key: v
-#% description: Verbose mode (print projection parameters and filenames to stderr)
-#%end
-
-
-
-if [ -z "$GISBASE" ] ; then
-   echo "You must be in GRASS GIS to run this program." 1>&2
-   exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-   exec g.parser "$0" "$@"
-fi
-
-# setting environment, so that awk works properly in all languages (needed?)
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-#### check for cs2cs
-if [ ! -x "`which cs2cs`" ] ; then
-   g.message -e "cs2cs program not found, install PROJ.4 first"
-   g.message "http://proj.maptools.org"
-   exit 1
-fi
-
-#### check for overenthusiasm
-if [ -n "$GIS_OPT_PROJ_IN" ] && [ $GIS_FLAG_I -eq 1 ] ; then
-   g.message -e "Chose only one input parameter method"
-   exit 1
-fi
-if [ -n "$GIS_OPT_PROJ_OUT" ] && [ $GIS_FLAG_O -eq 1 ] ; then
-   g.message -e "Chose only one output parameter method" 
-   exit 1
-fi
-if [ $GIS_FLAG_I -eq 1 ] && [ $GIS_FLAG_O -eq 1 ] ; then
-   g.message -e "Chose only one auto-projection parameter method"
-   exit 1
-fi
-if [ -n "$GIS_OPT_OUTPUT" ] && [ -e "$GIS_OPT_OUTPUT" ] ; then
-   g.message -e "Output file already exists" 
-   exit 1
-fi
-
-#### parse field separator
-if [ "$GIS_OPT_FS" = "space" ] || [ "$GIS_OPT_FS" = "tab" ] ; then
-   fs=" "
-else
-   fs="`echo "$GIS_OPT_FS" | cut -c1`"
-fi
-
-#### setup projection params
-PROJ_TYPE=`g.region -p | 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
-fi
-
-unset IN_PROJ
-if [ $GIS_FLAG_I -eq 1 ] ; then
-   IN_PROJ="+proj=longlat +datum=WGS84"
-   if [ $GIS_FLAG_V -eq 1 ] ; then
-     g.message "Assuming LL WGS84 as input, current projection as output."
-   fi
-fi
-if [ $GIS_FLAG_O -eq 1 ] ; then
-   IN_PROJ="`g.proj -jf`"
-fi
-if [ -n "$GIS_OPT_PROJ_IN" ] ; then
-   IN_PROJ="$GIS_OPT_PROJ_IN"
-fi
-if [ -z "$IN_PROJ" ] ; then
-   g.message -e "Missing input projection parameters."
-   rm -f "$TMP"
-   exit 1
-fi
-
-unset OUT_PROJ
-if [ $GIS_FLAG_O -eq 1 ] ; then
-   OUT_PROJ="+proj=longlat +datum=WGS84"
-   if [ $GIS_FLAG_V -eq 1 ] ; then
-     g.message "Assuming current projection as input, LL WGS84 as output."
-   fi
-fi
-if [ $GIS_FLAG_I -eq 1 ] ; then
-   OUT_PROJ="`g.proj -jf`"
-fi
-if [ -n "$GIS_OPT_PROJ_OUT" ] ; then
-   OUT_PROJ="$GIS_OPT_PROJ_OUT"
-fi
-if [ -z "$OUT_PROJ" ] ; then
-   g.message -e "Missing output projection parameters."
-   exit 1
-fi
-
-g.message message="input parameters=[$IN_PROJ]"
-g.message message="output parameters=[$OUT_PROJ]"
-
-#### setup temporary file
-TMP="`g.tempfile pid=$$`"
-if [ $? -ne 0 ] || [ -z "$TMP" ] ; then
-   g.message -e "Unable to create temporary file" 
-   exit 1
-fi
-
-#### setup input file
-if [ -z "$GIS_OPT_INPUT" ] || [ "$GIS_OPT_INPUT" = "-" ] ; then
-   # read from stdin to temp file
-   EXITCODE=0
-   while [ $EXITCODE -eq 0 ] ; do
-      unset REPLY
-      read REPLY
-      EXITCODE=$?
-      if [ -n "$REPLY" ] ; then
-	 echo "$REPLY" >> "$TMP"
-      fi
-   done
-
-   # make sure we have at least one line of data
-   if [ "`wc -l "$TMP" | cut -f1 -d' '`" -eq 0 ] ; then
-      g.message -e "ERROR reading data from stdin"
-      exit 1
-   fi
-   infile="$TMP"
-else
-   infile="$GIS_OPT_INPUT"
-fi
-
-if [ ! -f "$infile" ] ; then
-   g.message -e "Couldn't read input data." 
-   exit 1
-fi
-
-#### setup output file
-outfile="$GIS_OPT_OUTPUT"
-
-if [ -n "$infile" ] ; then
-    g.message message="input file=[$infile]"
-fi
-if [ -n "$outfile" ] ; then
-    g.message message="output file=[$outfile]" 
-fi
-
-#### setup output style
-if [ $GIS_FLAG_D -eq 0 ] ; then
-   OUTFMT=""
-else
-   OUTFMT="-f %.8f"
-fi
-
-#### do the conversion
-# Convert cs2cs DMS format to GRASS DMS format:
-#   cs2cs | sed -e 's/d/:/g' -e "s/'/:/g"  -e 's/"//g'
-
-if [ -z "$outfile" ] ; then
-   cat "$infile" | tr "$fs" ' ' | cs2cs $OUTFMT $IN_PROJ +to $OUT_PROJ
-   EXITCODE=$?
-else
-   cat "$infile" | tr "$fs" ' ' | cs2cs $OUTFMT $IN_PROJ +to $OUT_PROJ > "$outfile"
-   EXITCODE=$?
-
-   #### check if transform REALLY worked (e.g. bogus output if grid file not found)
-   if [ -n "`head -n 1 "$outfile" | grep '^\*'`" ] ; then
-      EXITCODE=1
-   fi
-fi
-
-if [ $EXITCODE -ne 0 ] ; then
-   g.message -w "Projection transform probably failed, please investigate."
-fi
-
-#### cleanup
-if [ -e "$TMP" ] ; then
-   rm -f "$TMP"
-fi
-
-exit 0

Deleted: grass/trunk/scripts/r.blend/r.blend
===================================================================
--- grass/trunk/scripts/r.blend/r.blend	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/r.blend/r.blend	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,102 +0,0 @@
-#!/bin/sh
-
-############################################################################
-#
-# MODULE:	r.blend for GRASS 5.7; based on blend.sh for GRASS 5
-# AUTHOR(S):	CERL?; updated to GRASS 5.7 by Michael Barton
-# PURPOSE:	To redraw current displayed maps to 24 bit PNG output
-# COPYRIGHT:	(C) 2004 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-#############################################################################
-
-#%Module
-#%  description: Blends color components of two raster maps by a given ratio.
-#%  keywords: raster
-#%End
-#%option
-#% key: first
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: Name of first raster map for blending
-#% key_desc : name
-#% required : yes
-#%end
-#%option
-#% key: second
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: Name of second raster map for blending
-#% key_desc : name
-#% required : yes
-#%end
-#%option
-#% key: output
-#% type: string
-#% description: Base name for red, green and blue output maps containing the blend
-#% key_desc : name
-#% required : yes
-#%end
-#%option
-#% key: percent
-#% type: integer
-#% answer: 2
-#% options : 0-99
-#% description: Percentage weight of first map for color blending
-#% required : no
-#%end
-
-if  [ -z "$GISBASE" ] ; then
-   echo "You must be in GRASS GIS to run this program." 1>&2
-   exit 1
-fi   
-
-# save command line
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    CMDLINE="`basename $0`"
-    for arg in "$@" ; do
-        CMDLINE="$CMDLINE \"$arg\""
-    done
-    export CMDLINE
-    exec g.parser "$0" "$@"
-fi
-
-if [ "$GRASS_OVERWRITE" != 1 ] ; then
-   for MAP in r g b ; do
-      g.findfile elem=cell file=${GIS_OPT_OUTPUT}.$MAP > /dev/null
-      if [ $? -eq 0 ] ; then
-         g.message -e "Raster map <${GIS_OPT_OUTPUT}.$MAP> already exists."
-         exit 1
-      fi
-   done
-fi
-
-PERC_INV=`expr 100 - $GIS_OPT_PERCENT`
-
-g.message "Calculating the three component maps..."
-r.mapcalc "$GIS_OPT_OUTPUT.r = r#$GIS_OPT_FIRST * .$GIS_OPT_PERCENT + (1.0 - .$GIS_OPT_PERCENT) * r#$GIS_OPT_SECOND"
-r.mapcalc "$GIS_OPT_OUTPUT.g = g#$GIS_OPT_FIRST * .$GIS_OPT_PERCENT + (1.0 - .$GIS_OPT_PERCENT) * g#$GIS_OPT_SECOND"
-r.mapcalc "$GIS_OPT_OUTPUT.b = b#$GIS_OPT_FIRST * .$GIS_OPT_PERCENT + (1.0 - .$GIS_OPT_PERCENT) * b#$GIS_OPT_SECOND"
-
-g.message "Setting color tables to grey..."
-# should this be "0 black \n 255 white"?
-for MAP in r g b ; do
-   r.colors map=${GIS_OPT_OUTPUT}.$MAP col=grey
-   r.support map=${GIS_OPT_OUTPUT}.$MAP title="Color blend of $GIS_OPT_FIRST and $GIS_OPT_SECOND" \
-      history=""
-   r.support map=${GIS_OPT_OUTPUT}.$MAP history="r.blend \"$MAP\" channel."
-   r.support map=${GIS_OPT_OUTPUT}.$MAP history="  ${GIS_OPT_PERCENT}% of $GIS_OPT_FIRST, ${PERC_INV}% of $GIS_OPT_SECOND"
-done
-
-# write cmd history:
-r.support ${GIS_OPT_OUTPUT}.r history="${CMDLINE}"
-r.support ${GIS_OPT_OUTPUT}.g history="${CMDLINE}"
-r.support ${GIS_OPT_OUTPUT}.b history="${CMDLINE}"
-
-g.message "Done. Use the following command to visualize the result:"
-g.message message="d.rgb r=${GIS_OPT_OUTPUT}.r g=${GIS_OPT_OUTPUT}.g b=${GIS_OPT_OUTPUT}.b"
-
-exit 0

Deleted: grass/trunk/scripts/r.fillnulls/r.fillnulls
===================================================================
--- grass/trunk/scripts/r.fillnulls/r.fillnulls	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/r.fillnulls/r.fillnulls	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,248 +0,0 @@
-#!/bin/sh
-#
-############################################################################
-#
-# MODULE:	r.fillnulls
-# AUTHOR(S):	Markus Neteler <neteler itc it>
-#               Updated to GRASS 5.7 by Michael Barton
-#               Updated to GRASS 6.0 by Markus Neteler
-#               Ring improvements by Hamish Bowman
-# PURPOSE:	fills NULL (no data areas) in raster maps
-#               The script respects a user mask (MASK) if present.
-#
-# COPYRIGHT:	(C) 2001,2004-2005 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-#############################################################################
-
-
-#%Module
-#% description: Fills no-data areas in raster maps using v.surf.rst splines interpolation
-#% keywords: raster, elevation, interpolation
-#%End
-#%option
-#% key: input
-#% gisprompt: old,cell,raster
-#% type: string
-#% description: Raster map in which to fill nulls
-#% required : yes
-#%end
-#%option
-#% key: output
-#% gisprompt: new,cell,raster
-#% type: string
-#% description: Output raster map with nulls filled by interpolation from surrounding values
-#% required : yes
-#%end
-#%option
-#% key: tension
-#% type: double
-#% description: Spline tension parameter
-#% required : no
-#% answer : 40.
-#%end
-#%option
-#% key: smooth
-#% type: double
-#% description: Spline smoothing parameter
-#% required : no
-#% answer : 0.1
-#%end
-
-if test "$GISBASE" = ""; then
- echo "You must be in GRASS GIS to run this program." >&2
- exit 1
-fi   
-
-# save command line
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    CMDLINE="`basename $0`"
-    for arg in "$@" ; do
-        CMDLINE="$CMDLINE \"$arg\""
-    done
-    export CMDLINE
-    exec g.parser "$0" "$@"
-fi
-PROG=`basename $0`
-
-#### check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message -e "awk required, please install awk or gawk first"
-    exit 1
-fi
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION=$GISDBASE/$LOCATION_NAME/$MAPSET
-
-# what to do in case of user break:
-exitprocedure()
-{
- g.message -e 'User break!'
- #delete internal mask and any TMP files:
- g.remove rast=$TMP1,$TMP1.buf,${TMP1}_filled > /dev/null
- g.remove vect=${VECTTMP} > /dev/null
- 
- #restore user mask if present:
- if test -f $LOCATION/cell/$USERMASK ; then
-  g.remove rast=MASK > /dev/null
-  g.rename $USERMASK,MASK > /dev/null
- fi
- exit 1
-}
-# shell check for user break (signal list: trap -l)
-trap "exitprocedure" 2 3 15
-
-program=`basename $0`
-
-#test:
-if [ ! $GIS_OPT_INPUT ]
-then
- g.message "Please provide an input map name."
- exit 1
-fi
-if [ ! $GIS_OPT_OUTPUT ]
-then
- g.message "Please provide an output name."
- exit 1
-fi
-
-#check if input file exists
-#if test -f $LOCATION/cell/$GIS_OPT_INPUT
-if [ -z `g.findfile elem=cell file="$GIS_OPT_INPUT" | grep ^file | cut -f2 -d=` ] ; then
-    g.message -e "<$GIS_OPT_INPUT> does not exist! Aborting."
-    exit 1
-fi
-
-#check if a MASK is already present:
-MASKTMP=mask.$$
-USERMASK=usermask_${MASKTMP}
-if test -f $LOCATION/cell/MASK
-then
- g.message "A user raster mask (MASK) is present. Saving it..."
- g.rename MASK,$USERMASK > /dev/null
-fi
-
-#make a mask of NULL cells
-TMP1=r_fillnulls_$$
-#echo "Using tmp file $TMP1"
-
-# idea: filter all NULLS and grow that area(s) by 3 pixel, then
-# interpolate from these surrounding 3 pixel edge
-
-g.message "Locating and isolating NULL areas..."
-#creating 0/1 map:
-r.mapcalc "$TMP1 = if(isnull($GIS_OPT_INPUT),1,null())"
-
-#generate a ring:
-# the buffer is set to three times the map resolution so you get nominally
-# three points around the edge. This way you interpolate into the hole with 
-# a trained slope & curvature at the edges, otherwise you just get a flat plane.
-# 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`
-RES="`echo $nsres $ewres | awk '{printf "%f", ($1+$2) * 3. / 2.}'`"  # avg*3
-
-r.buffer input=$TMP1 dist=$RES out=$TMP1.buf
-if [ $? -ne 0 ] ; then
-    g.message -e "$0 abandoned. Removing temporary map, restoring user mask if needed:"
-    g.remove rast=MASK,$TMP1,$TMP1.buf,${TMP1}_filled > /dev/null
-    g.remove vect=${VECTTMP} > /dev/null
-    g.rename $USERMASK,MASK > /dev/null
-    exit 1
-fi
-
-r.mapcalc "MASK = if($TMP1.buf==2,1,null())"
-
-# now we only see the outlines of the NULL areas if looking at INPUT.
-# Use this outline (raster border) for interpolating the fill data:
-VECTTMP=vecttmp_fillnulls_$$
-g.message "Creating interpolation points..."
-r.to.vect input=$GIS_OPT_INPUT output=${VECTTMP} feature=point
-if [ $? -ne 0 ] ; then
-    g.message -e "$0 abandoned. Removing temporary maps, restoring user mask if needed:"
-    g.remove rast=MASK,$TMP1,$TMP1.buf,${TMP1}_filled > /dev/null
-    g.remove vect=${VECTTMP} > /dev/null
-    g.rename $USERMASK,MASK > /dev/null
-    exit 1
-fi
-
-#count number of points to control segmax parameter for interpolation:
-POINTSNUMBER="`v.info map=${VECTTMP} | grep 'Number of points' | awk '{print $5}'`"
-
-g.message "Interpolating $POINTSNUMBER points"
-
-if [ $POINTSNUMBER -lt 2 ] ; then
-  g.message -w "Not sufficient points to interpolate. Maybe no hole(s) to fill in the current map region?"
-  #remove internal MASK first
-  g.remove MASK > /dev/null
-
-  #restoring user's mask, if present:
-  if test -f $LOCATION/cell/$USERMASK
-  then
-   g.message "Restoring user mask (MASK)..."
-   g.rename $USERMASK,MASK > /dev/null
-  fi
-  
-  #cleanup
-  g.remove rast=$TMP1,$TMP1.buf,${TMP1}_filled > /dev/null
-  g.remove vect=${VECTTMP} > /dev/null
-  exit 1
-fi
-
-g.message "Note: The following warnings may be ignored."
-
-#remove internal MASK first -- WHY???? MN 10/2005
-g.remove MASK > /dev/null
-
-if test -f $LOCATION/cell/$USERMASK
-then
-  g.message "Using user mask while interpolating"
-  RST_CMD="v.surf.rst zcol=value tension=$GIS_OPT_TENSION smooth=$GIS_OPT_SMOOTH maskmap=$USERMASK"
-else
-  RST_CMD="v.surf.rst zcol=value tension=$GIS_OPT_TENSION smooth=$GIS_OPT_SMOOTH"
-fi
-
-SEGMAX=600
-if [ $POINTSNUMBER  -ge $SEGMAX ] ; then
-  g.message "Using segmentation for interpolation..."
-  $RST_CMD input=${VECTTMP} elev=${TMP1}_filled #2> /dev/null
-else
-  #if less than $SEGMAX points, use no segmentation for speedup:
-  g.message "Using no segmentation for interpolation as not needed..."
-  $RST_CMD input=${VECTTMP} elev=${TMP1}_filled segmax=$SEGMAX #2> /dev/null
-fi
-
-g.message "Note: Above warnings may be ignored."
-
-#restoring user's mask, if present:
-if test -f $LOCATION/cell/$USERMASK
-then
- g.message "Restoring user mask (MASK)..."
- g.rename $USERMASK,MASK > /dev/null
-fi
-
-#patch orig and fill map
-g.message "Patching fill data into NULL areas..."
-# we can use --o here as g.parser already checks on startup
-r.patch in=$GIS_OPT_INPUT,${TMP1}_filled out=$GIS_OPT_OUTPUT --o
-
-#cleanup
-g.remove rast=$TMP1,$TMP1.buf,${TMP1}_filled > /dev/null
-g.remove vect=${VECTTMP} > /dev/null
-
-g.message "Filled raster map is: $GIS_OPT_OUTPUT"
-
-# write cmd history:
-r.support $GIS_OPT_OUTPUT history="${CMDLINE}"
-
-g.message "Done."

Deleted: grass/trunk/scripts/r.in.aster/r.in.aster
===================================================================
--- grass/trunk/scripts/r.in.aster/r.in.aster	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/r.in.aster/r.in.aster	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,174 +0,0 @@
-#!/bin/sh
-############################################################################
-#
-# MODULE:	r.in.aster
-# AUTHOR(S):	Michael Barton (michael.barton at asu.edu) and Paul Kelly
-# PURPOSE:	Rectifies, georeferences, & imports Terra-ASTER imagery 
-#			using gdalwarp
-# COPYRIGHT:	(C) 2004 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-#############################################################################
-
-# Requires:
-#   gdalwarp
-
-#%Module
-#%  description: Georeference, rectify and import Terra-ASTER imagery and relative DEM's using gdalwarp.
-#%  keywords: raster, imagery, import
-#%End
-#%option
-#% key: input
-#% type: string
-#% gisprompt: old_file,file,input
-#% description: Input ASTER image to be georeferenced & rectified
-#% required : yes
-#%end
-#%option
-#% key: proctype
-#% type: string
-#% description: ASTER imagery processing type (Level 1A, Level 1B, or relative DEM)
-#% options: L1A,L1B,DEM
-#% required : yes
-#%end
-#%option
-#% key: band
-#% type: string
-#% description: L1A or L1B band to translate (1, 2, 3n, 3b, 4-14). Can only translate a single band
-#% answer: 1
-#% required : yes
-#%end
-#%option
-#% key: output
-#% type: string
-#% description: Name for output raster map
-#% gisprompt: old,cell,raster
-#% required : yes
-#%end
-
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." >&2
- exit 1
-fi
-
-# save command line
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    CMDLINE="`basename $0`"
-    for arg in "$@" ; do
-        CMDLINE="$CMDLINE \"$arg\""
-    done
-    export CMDLINE
-    exec g.parser "$0" "$@"
-fi
-
-#initialize datasets for L1A and L1B
-
-if [ "$GIS_OPT_PROCTYPE" = "L1A" ]
-then
-	case $GIS_OPT_BAND in
-		1)
-		dataset="VNIR_Band1:ImageData" ;;
-		2)
-		dataset="VNIR_Band2:ImageData" ;;
-		3n)
-		dataset="VNIR_Band3N:ImageData" ;;
-		3b)
-		dataset="VNIR_Band3B:ImageData" ;;
-		4)
-		dataset="SWIR_Band4:ImageData" ;;
-		5)
-		dataset="SWIR_Band5:ImageData" ;;
-		6)
-		dataset="SWIR_Band6:ImageData" ;;
-		7)
-		dataset="SWIR_Band7:ImageData" ;;
-		8)
-		dataset="SWIR_Band8:ImageData" ;;
-		9)
-		dataset="SWIR_Band9:ImageData" ;;
-		10)
-		dataset="TIR_Band10:ImageData" ;;
-		11)
-		dataset="TIR_Band11:ImageData" ;;
-		12)
-		dataset="TIR_Band12:ImageData" ;;
-		13)
-		dataset="TIR_Band13:ImageData" ;;
-		14)
-		dataset="TIR_Band14:ImageData" ;;
-	esac
-	srcfile="HDF4_EOS:EOS_SWATH:"\"$GIS_OPT_INPUT\"":"$dataset
-elif [ "$GIS_OPT_PROCTYPE" = "L1B" ] 
-then
-	case $GIS_OPT_BAND in
-		1)
-		dataset="VNIR_Swath:ImageData1" ;;
-		2)
-		dataset="VNIR_Swath:ImageData2" ;;
-		3n)
-		dataset="VNIR_Swath:ImageData3N" ;;
-		3b)
-		dataset="VNIR_Swath:ImageData3B" ;;
-		4)
-		dataset="SWIR_Swath:ImageData4" ;;
-		5)
-		dataset="SWIR_Swath:ImageData5" ;;
-		6)
-		dataset="SWIR_Swath:ImageData6" ;;
-		7)
-		dataset="SWIR_Swath:ImageData7" ;;
-		8)
-		dataset="SWIR_Swath:ImageData8" ;;
-		9)
-		dataset="SWIR_Swath:ImageData9" ;;
-		10)
-		dataset="TIR_Swath:ImageData10" ;;
-		11)
-		dataset="TIR_Swath:ImageData11" ;;
-		12)
-		dataset="TIR_Swath:ImageData12" ;;
-		13)
-		dataset="TIR_Swath:ImageData13" ;;
-		14)
-		dataset="TIR_Swath:ImageData14" ;;
-	esac
-	srcfile="HDF4_EOS:EOS_SWATH:"\"$GIS_OPT_INPUT\"":"$dataset
-elif [ "$GIS_OPT_PROCTYPE" = "DEM" ] 
-then
-	srcfile="$GIS_OPT_INPUT"
-fi
-
-tempfile=`g.tempfile $$`.tif
-
-#run gdalwarp with selected options (must be in $PATH)
-#to translate aster image to geotiff
-g.message "Georeferencing aster image ..."
-proj=`g.proj -jf`
-echo $proj | grep 'XY location' > /dev/null
-if [ $? -eq 0 ] ; then
-  g.message -e "This module needs to be run in a projected location (found: $proj)"
-  exit 1
-fi
-
-g.message -d message="gdalwarp -t srs $proj $srcfile $tempfile"
-
-gdalwarp -t_srs "`g.proj -jf`" $srcfile $tempfile
-
-#import geotiff to GRASS
-g.message "Importing into GRASS ..."
-
-r.in.gdal input="$tempfile" output="$GIS_OPT_OUTPUT"
-
-#cleanup
-g.message "Cleaning up ..."
-rm -f "$tempfile"
-
-# write cmd history:
-r.support "$GIS_OPT_OUTPUT" history="${CMDLINE}"
-
-g.message "Done."
-

Deleted: grass/trunk/scripts/r.in.srtm/r.in.srtm
===================================================================
--- grass/trunk/scripts/r.in.srtm/r.in.srtm	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/r.in.srtm/r.in.srtm	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,268 +0,0 @@
-#!/bin/sh
-
-#import of SRTM hgt files into GRASS
-# written by Markus Neteler 11/2003 neteler AT itc it
-#
-# COPYRIGHT:	(C) 2004, 2006 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-# Dec 2004: merged with srtm_generate_hdr.sh (M. Neteler)
-#           corrections and refinement (W. Kyngesburye)
-# Aug 2004: modified to accept files from other directories
-#           (by H. Bowman)
-# June 2005: added flag to read in US 1-arcsec tiles (H. Bowman)
-# April 2006: links updated from ftp://e0dps01u.ecs.nasa.gov/srtm/             
-#             to current links below
-#########################
-#Derived from:
-# ftp://e0srp01u.ecs.nasa.gov/srtm/version1/Documentation/Notes_for_ARCInfo_users.txt
-#     (note: document was updated silently end of 2003)
-#
-# ftp://e0srp01u.ecs.nasa.gov/srtm/version1/Documentation/SRTM_Topo.txt
-#  "3.0 Data Formats
-#  [...]
-#  To be more exact, these coordinates refer to the geometric center of 
-#  the lower left pixel, which in the case of SRTM-1 data will be about
-#  30 meters in extent."
-#
-#- SRTM 90 Tiles are 1 degree by 1 degree
-#- SRTM filename coordinates are said to be the *center* of the LL pixel.
-#       N51E10 -> lower left cell center
-#
-#- BIL uses *center* of the UL (!) pixel:
-#      http://downloads.esri.com/support/whitepapers/other_/eximgav.pdf
-#  
-#- GDAL uses *corners* of pixels for its coordinates.
-#
-# NOTE: Even, if small difference: SRTM is referenced to EGM96, not WGS84 ellps
-# http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm96/intpt.html
-#
-#########################
-
-#%Module
-#%  description: Import SRTM HGT files into GRASS
-#%  keywords: raster, import
-#%End
-#%option
-#% key: input
-#% gisprompt: old_file,file,input
-#% type: string
-#% description: SRTM input tile (file without .hgt.zip extension)
-#% required : yes
-#%end
-#%option
-#% key: output
-#% gisprompt: new,cell,raster
-#% type: string
-#% description: Output raster map (default: input tile)
-#% required : no
-#%end
-#%flag
-#%  key: 1
-#%  description: Input is a 1-arcsec tile (default: 3-arcsec)
-#%end
-
-
-# what to do in case of user break:
-exitprocedure()
-{
-    g.message -e 'User break!'
-    exit 1
-}
-trap "exitprocedure" 2 3 15
-
-if test "$GISBASE" = ""; then
-    echo "You must be in GRASS GIS to run this program." >&2
-    exit 1
-fi
-
-# save command line
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    CMDLINE="`basename $0`"
-    for arg in "$@" ; do
-        CMDLINE="$CMDLINE \"$arg\""
-    done
-    export CMDLINE
-    exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-#### check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message -e "\"awk\" is required, please install awk or gawk first"
-    exit 1
-fi
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION="$GISDBASE/$LOCATION_NAME/$MAPSET"
-PERM="$GISDBASE/$LOCATION_NAME/PERMANENT"
-
-grep -i 'proj: ll' "$PERM/PROJ_INFO" > /dev/null
-if [ $? -ne 0 ] ; then
-    g.message -e "SRTM data are in Latitude/Longitude. The current\
-      location's projection differs. STOP."
-    exit 1
-fi
-
-# use these from now on:
-FILE=`echo "$GIS_OPT_INPUT" | sed 's+.hgt++'| sed 's+.zip++'`
-TILE=`echo "$FILE" | sed 's+^.*/++'`
-FDIR=`echo "$FILE" | sed 's+[^/]*$++'`
-
-if [ -z "$GIS_OPT_OUTPUT" ] ; then
-  TILEOUT="$TILE"
-else
-  TILEOUT="$GIS_OPT_OUTPUT"
-fi
-
-
-if [ -f "$FILE.hgt.zip" ] ; then
-    #### check if we have unzip
-    if [ ! -x "`which unzip`" ] ; then
-	g.message -e "The \"unzip\" program is required, please install it first"
-	exit 1
-    fi
-
-    # really a ZIP file?
-    # make it quiet in a safe way (just in case -qq isn't portable)
-    UNZIP=-qq
-    export UNZIP
-    unzip -t "$FILE.hgt.zip" 
-    if [ $? -ne 0 ] ; then
-	g.message -e "'$FILE.hgt.zip' does not appear to be a valid zip file."
-	exit 1
-    fi
-    IS_ZIP=1
-elif [ -f "$FILE.hgt" ] ; then
-    # try and see if it's already unzipped
-    IS_ZIP=0
-else
-    g.message -e "File '$FILE.hgt.zip' not found"
-    exit 1
-fi
-
-
-#make a temporary directory
-TMPDIR="`g.tempfile pid=$$`"
-if [ $? -ne 0 ] || [ -z "$TMPDIR" ] ; then
-    g.message "Unable to create temporary files"
-    exit 1
-fi
-rm -f "$TMPDIR"
-mkdir "$TMPDIR"
-
-if [ $IS_ZIP -eq 1 ] ; then
-    install -m 644 "$FILE.hgt.zip" "$TMPDIR"
-else
-    install -m 644 "$FILE.hgt" "$TMPDIR"
-fi
-
-
-#change to temporary directory
-cd "$TMPDIR"
-
-
-if [ $IS_ZIP -eq 1 ] ; then
-    #unzip & rename data file:
-    g.message  "Extracting '$FILE'..."
-    unzip "$FILE.hgt.zip"
-    if [ $? -gt 0 ] ; then
-	g.message -e "Unable to unzip file."
-	exit 1
-    fi
-fi
-
-g.message "Converting input file to BIL..."
-mv "$TILE.hgt" "${TMPDIR}/$TILE.bil"
-
-LL_LATITUDE=`echo $TILE  | cut -b2-3`
-LL_LONGITUDE=`echo $TILE | cut -b5-7`
-
-#are we on the southern hemisphere? If yes, make LATITUDE negative.
-NORTH=`echo $TILE  | sed 's+.hgt++g' | cut -b1`
-if [ "$NORTH" = "S" ] ; then
-   LL_LATITUDE=`echo $LL_LATITUDE | awk '{printf "%.10f", $1 * -1 }'`
-fi
-
-#are we west of Greenwich? If yes, make LONGITUDE negative.
-EAST=`echo $TILE  | sed 's+.hgt++g' | cut -b4`
-if [ "$EAST" = "W" ] ; then
-   LL_LONGITUDE=`echo $LL_LONGITUDE | awk '{printf "%.10f", $1 * -1 }'`
-fi
-
-# Calculate Upper Left from Lower Left
-ULXMAP=`echo $LL_LONGITUDE | awk '{printf "%.1f", $1}'`
-# SRTM90 tile size is 1 deg:
-ULYMAP=`echo $LL_LATITUDE  | awk '{printf "%.1f", $1 + 1.0}'`
-
-
-if [ $GIS_FLAG_1 -ne 1 ] ; then
-  echo "BYTEORDER M
-LAYOUT BIL
-NROWS 1201
-NCOLS 1201
-NBANDS 1
-NBITS 16
-BANDROWBYTES 2402
-TOTALROWBYTES 2402
-BANDGAPBYTES 0
-PIXELTYPE SIGNEDINT
-NODATA -32768
-ULXMAP $ULXMAP
-ULYMAP $ULYMAP
-XDIM 0.000833333333333
-YDIM 0.000833333333333"> "$TILE.hdr"
-else
-  g.message "Attempting to import 1-arcsec data."
-  echo "BYTEORDER M
-LAYOUT BIL
-NROWS 3601
-NCOLS 3601
-NBANDS 1
-NBITS 16
-BANDROWBYTES 7202
-TOTALROWBYTES 7202
-BANDGAPBYTES 0
-PIXELTYPE SIGNEDINT
-NODATA -32768
-ULXMAP $ULXMAP
-ULYMAP $ULYMAP
-XDIM 0.000277777777777778
-YDIM 0.000277777777777778"> "$TILE.hdr"
-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"
-
-r.in.gdal in="$TILE.bil" out="$TILEOUT"
-EXITCODE=$?
-
-\rm -f "$TILE.bil" "$TILE.hdr" "$TILE.prj" "$TILE.hgt.zip"
-cd ..
-rmdir "$TMPDIR"
-
-if [ "$EXITCODE" -ne 0 ] ; then
-   g.message -e "Unable to import data"
-   exit 1
-fi
-
-
-#nice color table #and zoom to tile
-r.colors color=srtm map="$TILEOUT"
-#g.region rast=$TILEOUT
-
-# write cmd history:
-r.support $TILEOUT history="${CMDLINE}"
-
-g.message "Done: generated map $TILEOUT"
-g.message "(Note: Holes in the data can be closed with 'r.fillnulls' using splines)"

Deleted: grass/trunk/scripts/r.mask/r.mask
===================================================================
--- grass/trunk/scripts/r.mask/r.mask	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/r.mask/r.mask	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,110 +0,0 @@
-#!/bin/sh
-#
-############################################################################
-#
-# MODULE:       r.mask
-# AUTHOR(S):	Michael Barton, Arizona State University
-#               Markus Neteler
-# PURPOSE:	    Facilitates creation of raster MASK using r.reclass
-# COPYRIGHT:	(C) 2005, 2007 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-#############################################################################
-
-
-#%Module
-#%  description: Create a MASK for limiting raster operation
-#%  keywords: raster, mask
-#%End
-#%option
-#% key: input
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: Raster map to use as MASK
-#% required : yes
-#%END
-#%option
-#% key: maskcats
-#% type: string
-#% description: Category values to use for MASK (format: 1 2 3 thru 7 *)
-#% answer: *
-#%END
-#%flag
-#% key: i
-#% description: Create inverse MASK from specified 'maskcats' list
-#%END
-#%flag
-#% key: o
-#% description: Overwrite existing MASK
-#%END
-#%flag
-#% key: r
-#% description: Remove existing MASK (overrides other options)
-#%END
-
-
-if  [ -z "$GISBASE" ] ; then
- echo "You must be in GRASS GIS to run this program." >&2
- exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-  exec g.parser "$0" "$@"
-fi
-
-# temp file
-TMP="r_mask_$$"
-
-cleanup()
-{
- g.remove --q rast=$TMP
-}
-
-# what to do in case of user break:
-exitprocedure()
-{
- g.message -e 'User break!'
- cleanup
- exit 1
-}
-
-# shell check for user break (signal list: trap -l)
-trap "exitprocedure" 2 3 15
-
-if [ "$GIS_FLAG_R" -eq 1 ]; then
-	if test -f `g.gisenv GISDBASE`/`g.gisenv LOCATION_NAME`/`g.gisenv MAPSET`/cell/MASK ; then
- 		g.remove rast=MASK
- 		g.message "Raster MASK removed"
- 	else
- 		g.message -w "No existing MASK to remove"
-	fi
-else
-
-	if [ "$GIS_FLAG_O" -eq 1 ]; then
-		echo "$GIS_OPT_MASKCATS = 1" | r.reclass input=$GIS_OPT_INPUT output=MASK --o
-	else 
-		# does map exist in CURRENT mapset?
-		eval `g.findfile element=cell file=MASK mapset=$MAPSET`
-		if [ "$file" ] ; then
-		   g.message -e "MASK already found in current mapset. Delete first or overwrite"
-		   exit 1
-		fi
-
-		echo "$GIS_OPT_MASKCATS = 1" | r.reclass input=$GIS_OPT_INPUT output=MASK
-	fi
-
-        if [ "$GIS_FLAG_I" -eq 1 ]; then
-		g.rename --q rast=MASK,$TMP
-		r.mapcalc "MASK=if(isnull($TMP),1,null())"
-		g.remove --q rast=$TMP
-		g.message "Inverted MASK created. All subsequent raster operations"
-	else
-	  g.message "MASK created. All subsequent raster operations"
-	fi
-        g.message "will be limited to MASK area"
-        g.message "Removing or renaming raster file named MASK will"
-        g.message "restore raster operations to normal"
-fi

Deleted: grass/trunk/scripts/r.out.xyz/r.out.xyz
===================================================================
--- grass/trunk/scripts/r.out.xyz/r.out.xyz	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/r.out.xyz/r.out.xyz	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,64 +0,0 @@
-#!/bin/sh
-############################################################################
-#
-# MODULE:       r.out.xyz
-# AUTHOR:       M. Hamish Bowman, Dept. Marine Science, Otago Univeristy,
-#                 New Zealand
-# PURPOSE:      Export a raster map as x,y,z values based on cell centers
-#               This is a simple wrapper script for "r.stats -1ng"
-#
-# COPYRIGHT:    (c) 2006 Hamish Bowman, and the GRASS Development Team
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-#############################################################################
-
-#%Module
-#% description: Export a raster map to a text file as x,y,z values based on cell centers.
-#% keywords: raster, export
-#%End
-#%option
-#% key: input
-#% type: string
-#% gisprompt: old,cell,raster
-#% key_desc: name
-#% description: Name of input raster map 
-#% required: yes
-#%end
-#%option
-#% key: output
-#% type: string
-#% gisprompt: new_file,file,output
-#% key_desc: name
-#% description: Name for output file (if omitted or "-" output to stdout)
-#% required: no
-#%end
-#%option
-#% key: fs
-#% type: string
-#% key_desc: character
-#% description: Field separator
-#% answer: |
-#% required: no
-#%end
-
-# add a flag to include null values (! r.stats -n)?
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." 1>&2
-    exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    exec g.parser "$0" "$@"
-fi
-
-# if no output filename, output to stdout
-if  [ -z "$GIS_OPT_OUTPUT" ] || [ "$GIS_OPT_OUTPUT" = "-" ]; then
-    r.stats -1gn "$GIS_OPT_INPUT" fs="$GIS_OPT_FS"
-else
-    r.stats -1gn "$GIS_OPT_INPUT" fs="$GIS_OPT_FS" > "$GIS_OPT_OUTPUT"
-fi
-
-exit $?

Deleted: grass/trunk/scripts/r.plane/r.plane
===================================================================
--- grass/trunk/scripts/r.plane/r.plane	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/r.plane/r.plane	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,267 +0,0 @@
-#!/bin/sh
-#
-############################################################################
-#
-# MODULE:	r.plane for GRASS 5.7; based on r.plane for GRASS 5
-# AUTHOR(S):	CERL?; updated to GRASS 5.7 by Michael Barton
-#               Dec 2004: Alessandro Frigeri & Ivan Marchesini
-#               Modified to produce floating and double values maps
-# PURPOSE:	Creates a raster plane map from user specified inclination and azimuth
-# COPYRIGHT:	(C) 2004 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-#############################################################################
-
-#%Module
-#%  description: Creates raster plane map given dip (inclination), aspect (azimuth) and one point.
-#%  keywords: raster, elevation
-#%End
-#%option
-#% key: name
-#% type: string
-#% gisprompt: new,cell,raster
-#% description: Name of raster plane to be created
-#% required : yes
-#%end
-#%option
-#% key: dip
-#% type: double
-#% gisprompt: -90-90
-#% answer: 0.0
-#% description: Dip of plane. Value must be between -90 and 90 degrees
-#% required : yes
-#%end
-#%option
-#% key: azimuth
-#% type: double
-#% gisprompt: 0-360
-#% answer: 0.0
-#% description: Azimuth of the plane. Value must be between 0 and 360 degrees
-#% required : yes
-#%end
-#%option
-#% key: easting
-#% type: double
-#% description: Easting coordinate of a point on the plane
-#% required : yes
-#%end
-#%option
-#% key: northing
-#% type: double
-#% description: Northing coordinate of a point on the plane
-#% required : yes
-#%end
-#%option
-#% key: elevation
-#% type: double
-#% description: Elevation coordinate of a point on the plane
-#% required : yes
-#%end
-#%option
-#% key: type
-#% type: string 
-#% options: int,float,double
-#% description: Type of the raster map to be created
-#% required : yes
-#%end
-
-if  [ -z "$GISBASE" ] ; then
- echo "You must be in GRASS GIS to run this program." >&2
- exit 1
-fi   
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-  exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-#### check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message -e "awk required, please install awk or gawk first"
-    exit 1
-fi
-
-#### setup temporary file
-TMP="`g.tempfile pid=$$`"
-if [ $? -ne 0 ] || [ -z "$TMP" ] ; then
-    g.message -e "unable to create temporary files" 
-    exit 1
-fi
-
-#### trap ctrl-c so that we can clean up tmp
-trap 'rm -f "$TMP"*' 2 3 15
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-### setup enviro vars ###
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION=$GISDBASE/$LOCATION_NAME/$MAPSET
-
-dip=$GIS_OPT_DIP
-az=$GIS_OPT_AZIMUTH
-ea=$GIS_OPT_EASTING
-no=$GIS_OPT_NORTHING
-el=$GIS_OPT_ELEVATION
-name="$GIS_OPT_NAME"
-type=$GIS_OPT_TYPE
-
-eval `g.region -g`
-
-
-### test input values ###
-diptest=`echo $dip | awk '{ printf("%8d", int($1 + 0.5))'}`
-if [ $diptest -lt -90 -o $diptest -gt 90 ]
-then
-	g.message -e "Sorry, dip must be greater than -90 and less than 90.\
-	  Please enter a valid value."
-	exit 1
-fi
-
-aztest=`echo $az | awk '{ printf("%8d", int($1 + 0.5))'}`
-if  [ $aztest -lt 0 -o $aztest -ge 360 ]
-then
-	g.message -e "Sorry, azimuth must be no less than 0 and less than 360"
-	exit 1
-fi
-
-if  [ $type = "int" ]
-then
-        g.message "Preparing to produce a CELL map.."
-	typeflag=''
-	ctype=cell
-fi
-
-if  [ $type = "float" ]
-then
-        g.message "Preparing to produce an FCELL map.."
-        typeflag=-f
-        ctype=fcell
-fi
-
-if  [ $type = "double" ]
-then
-        g.message "Preparing to produce a DCELL map.."
-        typeflag=-d
-        ctype=dcell
-fi
-
-# these tests will fail for negative lat/lon?
-eaint=`echo $ea | awk '{ printf "%d",int($1 + 0.5) }'`
-if test $eaint -le `echo $e | cut -d. -f1` -a $eaint -ge `echo $w | cut -d. -f1`
-then
-	gotit=1
-#	echo "east: $ea"
-else
-	g.message -e "Sorry, point must be within current region"
-	g.message -e "Current region:"
-	g.message -e "west: $w   east: $e"
-	exit 1
-fi
-
-noint=`echo $no | awk '{ printf "%d", int($1 + 0.5) }'`
-if test $noint -gt `echo $s | cut -d. -f1` -a $noint -lt `echo $n | cut -d. -f1`
-then
-	gotit=1
-#	echo "north: $no"
-else
-	g.message -e "Sorry, point must be within current region"
-	g.message -e "Current region:"
-	g.message -e "south: $s   north: $n"
-	exit 1
-fi
-
-
-### now the actual algorithm in awk (stored in a temporary file) ###
-cat > "$TMP" << EOF
-
-{
-if (NR==1) {
-# print file header
-  rows = (north-south) / nsres
-  cols = (east-west) / ewres
-    printf("east:     %d\n",east)
-    printf("west:     %d\n",west)
-    printf("south:    %d\n",south)
-    printf("north:    %d\n",north)
-    printf("cols:     %d\n",cols)
-    printf("rows:     %d\n",rows)
-    cells=rows*cols
-    z=1
-    }
-
-if (NR==2) {
-    pi=3.14159265358979323846
-    a2=(az*pi)/180
-    dip2=(dip*pi)/180 
-    tandip=(sin(dip2)/cos(dip2))
-    northc=north-(0.5*nsres)
-    southc=south+(0.5*nsres)
-    eastc=east-(0.5*ewres)
-    westc=west+(0.5*ewres)
-   
-    for (y=northc; y >= southc; y=y-nsres) {
-       for (x=westc; x <= eastc; x=x+ewres) {
-	 dx=(ea-x)
-	 dy=(y-no)
- 	 dist = sqrt((dx*dx) + (dy*dy))
-	 if (dist==0) {
-	   new_elev[z]=el
-	   }
-	 else {
-	   gamma = atan2((dx/dist),(dy/dist))
-	   epsilon=a2-gamma
-	   d=dist*cos(epsilon)
-	   h=(d*sin(dip2)/cos(dip2))	
-	   #print h
-	   new_elev[z]=el-h
-	   z++
-	   }
-         }
-     }
-}
-if (NR>=2) {
-}
-}
-END {  
-      for (z=1; z <= cells; z++) {
-        if (typeflag==""){
- 	  printf " %d",new_elev[z]
-	  }
-	else {
-	  printf " %f",new_elev[z]
-	  }
- 	}
-}
-
-EOF
-
-
-### execute awk and remove temporary file ###
-
-awk  -f "$TMP" -v east=$e west=$w north=$n south=$s ea=$ea no=$no typeflag=$typeflag \
-  nsres=$nsres ewres=$ewres  dip=$dip az=$az el=$el "$TMP" > "$TMP".2
-
-rm -f "$TMP"
-
-g.message "Running r.in.ascii, please stand by.."
-r.in.ascii `echo $typeflag` i="$TMP".2 o=$name
-
-r.support $name hist="$PROG name=$name dip=$dip azimuth=$az easting=$ea \\"
-r.support $name hist="northing=$no elevation=$el type=$type"
-
-g.message "Done."
-g.message message="Raster map <$name@$MAPSET> generated by r.plane \
-  at point $ea E, $no N, elevation $el with dip=$dip degrees and \
-  aspect=$az degrees ccw from north."
-#echo "$dat, user: $user"
-
-rm -f "$TMP".2
-

Deleted: grass/trunk/scripts/r.reclass.area/r.reclass.area
===================================================================
--- grass/trunk/scripts/r.reclass.area/r.reclass.area	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/r.reclass.area/r.reclass.area	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,167 +0,0 @@
-#!/bin/sh
-
-############################################################################
-#
-# MODULE:       r.reclass.area
-# AUTHOR(S):    NRCS
-# PURPOSE:      Reclasses a raster map greater or less than user specified area size (in hectares)
-# COPYRIGHT:    (C) 1999 by the GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-#############################################################################
-# 3/2007: added label support MN
-# 3/2004: added parser support MN
-# 11/2001 added mapset support markus
-# 2/2001 fixes markus
-# 2000: updated to GRASS 5
-# 1998 from NRCS, slightly modified for GRASS 4.2.1
-
-#%Module
-#%  description: Reclasses a raster map greater or less than user specified area size (in hectares)
-#%  keywords: raster, statistics, aggregation
-#%End
-#%option
-#% key: input
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: raster input map
-#% required : yes
-#%END
-#%option
-#% key: lesser
-#% type: double
-#% description: lesser val option that sets the <= area size limit [hectares]
-#%END
-#%option
-#% key: greater
-#% type: double
-#% description: greater val option that sets the >= area size limit [hectares]
-#%END
-#%option
-#% key: output
-#% type: string
-#% gisprompt: new,cell,raster
-#% description: reclass raster output map
-#% required : yes
-#%END
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." >&2
-    exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-  exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-#### check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message -e "awk required, please install awk or gawk first"
-    exit 1
-fi
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-infile="$GIS_OPT_INPUT"
-outfile="$GIS_OPT_OUTPUT"
-
-g.region -p | 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."
- exit 1
-fi
-
-if [ -n "$GIS_OPT_LESSER" ] ; then
-  op=0
-  limit=$GIS_OPT_LESSER
-fi
-if [ -n "$GIS_OPT_GREATER" ] ; then
-  op=1
-  limit=$GIS_OPT_GREATER
-fi
-if [ -z "$GIS_OPT_GREATER" -a -z "$GIS_OPT_LESSER" ] ; then
-  g "ERROR: you have to specify either lesser= or greater="
-  exit 1
-fi
- 
-
-file2="$infile.clump.$outfile"
-
-eval `g.findfile element=cell file=$infile`
-filename="${fullname}"
-BASE="${name}"
-if [ "$filename" = "" ] ; then
-  g.message -e "Raster map [$infile] does not exist."
-  exit 1
-else
-  infile="$filename"
-fi
-
-eval `g.findfile element=cell file=$file2`
-filename2="${fullname}"
-BASE="${name}"
-if test "$filename2" ; then
-  g.message -e "Temporal raster map [$filename2] exists."
-  exit 1
-else
- g.message "Generating a clumped raster file ..."
- r.clump input="$infile" output="$file2"
-fi
-
-## calculation in acres
-#if test "$limit" = ""; then
-#echo 
-#echo "Generating a reclass rules file by acres"
-#r.stats -az in=$file2,$file |awk '{acre=$3 * 0.0002471; printf("%d = %.0f\n",$1,acre)}' >$infile.rules
-#else
-#  if test $op = 0; then
-#echo 
-#echo "Generating a reclass rules file by acres less than or equal to $limit"
-#  r.stats -az in=$file2,$infile | awk '{limit='$limit'; acre=$3 * 0.0002471; 
-#{if (acre <= limit) printf("%d = %d\n",$1,$2)}}' >$infile.rules
-#  else
-#echo 
-#echo "Generating a reclass rules file by acres greater than or equal to $limit"
-#  r.stats -az in=$file2,$infile | awk '{limit='$limit'; acre=$3 * 0.0002471; 
-#{if (acre >= limit) printf("%d = %d\n",$1,$2)}}' >$infile.rules
-#  fi
-#fi
-
-## calculation in hectares
-#if test "$limit" = ""; then
-# 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"
-# else
-if test $op = 0; then
-   g.message "Generating a reclass rules file with area size less than or equal to $limit hectares"
-   r.stats -aln in=$file2,$infile fs='|' | awk -F'|' '{limit='$limit'; hectares=$5 * 0.0001; 
-     {if (hectares <= limit) printf("%d = %d %s\n",$1,$3,$4)}}' > "$infile.rules"
-  else
-   g.message  "Generating a reclass rules file with area size greater than or equal to $limit hectares"
-   r.stats -aln in=$file2,$infile fs='|' | awk -F'|' '{limit='$limit'; hectares=$5 * 0.0001; 
-     {if (hectares >= limit) printf("%d = %d %s\n",$1,$3,$4)}}' > "$infile.rules"
-fi
-#fi
-
-if test "$outfile" = ""; then
-   outfile="${infile}_${limit}"
-fi
-g.message "Generating reclass raster map <$outfile>"
-cat "$infile.rules" | r.reclass i="$file2" o="$outfile.recl"
-r.mapcalc "$outfile=$outfile.recl"
-g.message "Written: $outfile"
-g.remove rast="$outfile.recl","$file2" --quiet
-
-#####cleanup
-rm -f "$infile.rules"

Deleted: grass/trunk/scripts/r.regression.line/r.regression.line
===================================================================
--- grass/trunk/scripts/r.regression.line/r.regression.line	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/r.regression.line/r.regression.line	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,157 +0,0 @@
-#!/bin/sh
-#
-############################################################################
-#
-# MODULE:	r.regression line
-# AUTHOR(S):	Dr. Agustin Lobo - alobo at ija.csic.es
-#               Updated to GRASS 5.7 by Michael Barton
-# PURPOSE:	Calculates linear regression from two raster maps: y = a + b*x
-# COPYRIGHT:	(C) 2004 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-#############################################################################
-
-
-#%Module
-#%  description: Calculates linear regression from two raster maps: y = a + b*x
-#%  keywords: raster, statistics
-#%End
-#%flag
-#%  key: g
-#%  description: Print in shell script style
-#%End
-#%flag
-#%  key: s
-#%  description: Slower but accurate (applies to FP maps only)
-#%End
-#%option
-#% key: map1
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: Map for x coefficient
-#% required : yes
-#%end
-#%option
-#% key: map2
-#% type: string
-#% gisprompt: old,cell,raster
-#% description: Map for y coefficient
-#% required : yes
-#%end
-#%option
-#% key: output
-#% type: string
-#% gisprompt: new_file,file,output
-#% description: ASCII file for storing regression coefficients (output to screen if file not specified).
-#% required : no
-#%end
-
-if  [ -z "$GISBASE" ] ; then
- echo "You must be in GRASS GIS to run this program." >&2
- exit 1
-fi   
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-  exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-#### check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message -e "awk required, please install awk or gawk first" 
-    exit 1
-fi
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-ok=yes
-eval `g.findfile element=cell file=$GIS_OPT_MAP1`
-if [ -z "$name" ] ; then
-      g.message -e "Raster map <$GIS_OPT_MAP1> not found"
-      ok=no
-fi
-eval `g.findfile element=cell file=$GIS_OPT_MAP2`
-if [ -z "$name" ] ; then
-      g.message -e "Raster map <$GIS_OPT_MAP2> not found"
-      ok=no
-fi
-if [ "$ok" = "no" ] ; then
- exit 1
-fi
-
-TMP="`g.tempfile pid=$$`"
-if [ $? -ne 0 ] || [ -z "$TMP" ] ; then
-    g.message -e "Unable to create temporary files"
-    exit 1
-fi
-
-
-#calculate regression equation
-if [ $GIS_FLAG_S -eq 1 ] ; then
-   # slower but accurate
-   r.stats -n1  input=$GIS_OPT_MAP1,$GIS_OPT_MAP2 | sed 's+$+ 1+g' > "$TMP"
-else
-   # count "identical" pixels
-   r.stats -cnA input=$GIS_OPT_MAP1,$GIS_OPT_MAP2  > "$TMP"
-fi
-
-if [ ! -s "$TMP" ] ; then
-    g.message -e "One or both input maps only contain no data (NULL) pixels in the current region"
-    exit 1
-fi
-
-awk '{tot += $3;sumX +=$1 * $3; sumsqX +=$1*$1*$3;sumY +=$2 * $3; sumsqY +=$2*$2*$3;\
- sumXY +=$1*$2*$3;\
-}\
-END {B=(sumXY - sumX*sumY/tot)/(sumsqX - sumX*sumX/tot);\
-R= (sumXY - sumX*sumY/tot)/((sumsqX - sumX^2/tot)*(sumsqY - sumY^2/tot))^0.5;\
-mediaX=sumX/tot;sumsqX=sumsqX/tot;varX=sumsqX-(mediaX^2);sdX=varX^0.5;\
-mediaY=sumY/tot;sumsqY=sumsqY/tot;varY=sumsqY-(mediaY^2);sdY=varY^0.5;\
-A=mediaY - B*mediaX; F= R^2/(1-R^2/tot-2);\
-print A, B, R, tot, F, mediaX, sdX, mediaY, sdY}' "$TMP" > "$TMP"b
-
-echo "a b R N F medX sdX medY sdY" | tr -s ' ' '\n' > "$TMP"d
-cat "$TMP"b | tr -s ' ' '\n' > "$TMP"e
-
-#send output to screen or text file
-if [ -z "$GIS_OPT_OUTPUT" ] 
-then
-	if [ $GIS_FLAG_G -eq 1 ] ; then
-	   paste -d'=' "$TMP"d "$TMP"e
-	else
-	   echo "y = a + b*x"
-           echo "   a: offset"
-           echo "   b: gain"
-           echo "   R: sumXY - sumX*sumY/tot"
-           echo "   N: number of elements"
-           echo "   medX, medY: Means"
-           echo "   sdX, sdY: Standard deviations"
-           echo "a  b  R  N  F medX  sdX  medY  sdY"
-	   RESULTADO=`cat "$TMP"b`
-           echo ${RESULTADO}
-	fi
-else
-	if [ $GIS_FLAG_G -eq 1 ] ; then
-	   paste -d'=' "$TMP"d "$TMP"e >> "$TMP"c
-	else
-	   echo "y = a + b*x" > "$TMP"c
-           echo "   a: offset" >> "$TMP"c
-           echo "   b: gain" >> "$TMP"c
-           echo "   R: sumXY - sumX*sumY/tot" >> "$TMP"c
-           echo "   N: number of elements" >> "$TMP"c
-           echo "   medX, medY: Means" >> "$TMP"c
-           echo "   sdX, sdY: Standard deviations" >> "$TMP"c
-           echo "a  b  R  N  F medX  sdX  medY  sdY" >> "$TMP"c
-	   cat "$TMP"b >> "$TMP"c
-	fi
-	mv "$TMP"c "$GIS_OPT_OUTPUT"
-	cat "$GIS_OPT_OUTPUT"
-fi
-rm -f "$TMP" "$TMP"b "$TMP"c "$TMP"d "$TMP"e

Deleted: grass/trunk/scripts/r.shaded.relief/r.shaded.relief
===================================================================
--- grass/trunk/scripts/r.shaded.relief/r.shaded.relief	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/r.shaded.relief/r.shaded.relief	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,218 +0,0 @@
-#!/bin/sh
-
-############################################################################
-#
-# MODULE:       r.shaded.relief
-# AUTHOR(S):	CERL
-#               parameters standardized: Markus Neteler, 2008
-#               updates: Michael Barton, 2004
-#               updates: Gordon Keith, 2003
-#               updates: Andreas Lange, 2001
-#               updates: David Finlayson, 2001
-#               updates: Markus Neteler, 2001, 1999
-# PURPOSE:	Creates shaded relief map from raster elevation map (DEM)
-# COPYRIGHT:	(C) 1999 - 2008 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-#############################################################################
-#
-#   July 2007 - allow input from other mapsets (Brad Douglas)
-#
-#   May 2005 - fixed wrong units parameter (Markus Neteler)
-#
-#   September 2004 - Added z exaggeration control (Michael Barton) 
-#   April 2004 - updated for GRASS 5.7 by Michael Barton 
-#
-#   9/2004 Adds scale factor input (as per documentation); units set scale only if specified for lat/long regions
-#    Also, adds option of controlling z-exaggeration.
-#
-#   6/2003 fixes for Lat/Long Gordon Keith <gordon.keith at csiro.au>
-#   If n is a number then the ewres and nsres are mulitplied by that scale
-#    to calculate the shading.
-#   If n is the letter M (either case) the number of metres is degree of
-#    latitude is used as the scale.
-#   If n is the letter f then the number of feet in a degree is used.
-#   It scales latitude and longitude equally, so it's only approximately
-#   right, but for shading its close enough. It makes the difference
-#   between an unusable and usable shade.
-#
-#   10/2001 fix for testing for dashes in raster file name
-#        by Andreas Lange <andreas.lange at rhein-main.de>
-#   10/2001 added parser support - Markus Neteler
-#   9/2001 fix to keep NULLs as is (was value 22 before) - Markus Neteler
-#   1/2001 fix for NULL by David Finlayson <david_finlayson at yahoo.com>
-#   11/99 updated $ewres to ewres() and $nsres to nsres()
-#       updated number to FP in r.mapcalc statement Markus Neteler
-
-#% Module
-#%  description: Creates shaded relief map from an elevation map (DEM).
-#%  keywords: raster, elevation
-#% End
-#% option
-#%  key: input
-#%  type: string
-#%  gisprompt: old,cell,raster
-#%  description: Input elevation map
-#%  required : yes
-#% end
-#% option
-#%  key: output
-#%  type: string
-#%  gisprompt: new,cell,raster
-#%  description: Output shaded relief map name
-#%  required : no
-#% end
-#% option
-#%  key: altitude
-#%  type: integer
-#%  description: Altitude of the sun in degrees above the horizon
-#%  required : no
-#%  options : 0-90
-#%  answer: 30
-#% end
-#% option
-#%  key: azimuth
-#%  type: integer
-#%  description: Azimuth of the sun in degrees to the east of north
-#%  required : no
-#%  options : 0-360
-#%  answer: 270
-#% end
-#% option
-#%  key: zmult    
-#%  type: double
-#%  description: Factor for exaggerating relief
-#%  required : no
-#%  answer: 1
-#% end
-#% option
-#%  key: scale
-#%  type: double
-#%  description: Scale factor for converting horizontal units to elevation units
-#%  required : no
-#%  answer: 1
-#% end
-#% option
-#%  key: units
-#%  type: string
-#%  description: Set scaling factor (applies to lat./long. locations only, none: scale=1)
-#%  required : no
-#%  options: none,meters,feet
-#%  answer: none
-#% end
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." >&2
- exit 1
-fi
-
-# save command line
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    CMDLINE="`basename $0`"
-    for arg in "$@" ; do
-        CMDLINE="$CMDLINE \"$arg\""
-    done
-    export CMDLINE
-    exec g.parser "$0" "$@"
-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=//`
-
-PROG=`basename $0`
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-alt=$GIS_OPT_ALTITUDE
-az=$GIS_OPT_AZIMUTH
-elev=$GIS_OPT_INPUT
-zmult=$GIS_OPT_ZMULT
-scale=$GIS_OPT_SCALE
-
-eval `g.findfile element=cell file=$elev`
-if [ -z "$name" ] ; then
-   g.message -e  "Map <$elev> not found."
-   exit 1
-fi
-
-if [ "$GIS_OPT_INPUT" = "$GIS_OPT_OUTPUT" ]; then
-	g.message -e "Input elevation map and output relief map must have different names"
-	exit 1
-fi
-
-if [ -z "$GIS_OPT_OUTPUT" ]; then
-    ELEVSHADE="${elev%%@*}.shade"
-else
-    ELEVSHADE="$GIS_OPT_OUTPUT"
-fi
-
-# allow - and . chars in the map name
-elev="\"$elev\""
-elev_out="\"$ELEVSHADE\""
-
-#LatLong locations only:
-if [ "$GIS_OPT_UNITS" = "meters" ] ; then
-   #scale=111120
-   scale=`echo $scale | awk '{printf("%f", $1 * 1852*60 )}'`
-fi
-
-#LatLong locations only:
-if [ "$GIS_OPT_UNITS" = "feet" ] ; then
-   #scale=364567.2
-   scale=`echo $scale | awk '{printf("%f", $1 * 6076.12*60 )}'`
-fi		
-
-#correct azimuth to East (GRASS convention):
-az=`expr $az - 90`
-
-g.message "Calculating shading, please stand by."
-
-# Note: no space allowed after \\:
-
-r.mapcalc << EOF
-$elev_out = eval( \\
- x=($zmult*$elev[-1,-1] + 2*$zmult*$elev[0,-1] + $zmult*$elev[1,-1] \\
-   -$zmult*$elev[-1,1] - 2*$zmult*$elev[0,1] - $zmult*$elev[1,1])/(8.*ewres()*$scale) , \\
- y=($zmult*$elev[-1,-1] + 2*$zmult*$elev[-1,0] + $zmult*$elev[-1,1] \\
-   -$zmult*$elev[1,-1] - 2*$zmult*$elev[1,0] - $zmult*$elev[1,1])/(8.*nsres()*$scale) , \\
- slope=90.-atan(sqrt(x*x + y*y)), \\
- a=round(atan(x,y)), \\
- a=if(isnull(a),1,a), \\
- aspect=if(x!=0||y!=0,if(a,a,360.)), \\
- cang = sin($alt)*sin(slope) + cos($alt)*cos(slope) * cos($az-aspect), \\
- if(cang < 0.,0.,100.*cang), \\
- if(isnull(cang), null(), 100.*cang))
-EOF
-
-if [ $? -ne 0 ] ; then 
-   g.message -e "In calculation, script aborted."
-   exit 1
-fi
-
-r.colors "$ELEVSHADE" color=grey
-
-# record metadata
-r.support "$ELEVSHADE" title="Shaded relief of \"$GIS_OPT_INPUT\"" history=""
-r.support "$ELEVSHADE" history="r.shaded.relief settings:"
-r.support "$ELEVSHADE" history="  altitude=$alt  azimuth=$GIS_OPT_AZIMUTH  zmult=$zmult  scale=$GIS_OPT_SCALE"
-if [ -n "$GIS_OPT_UNITS" ] ; then
-   r.support map="$ELEVSHADE" history="  units=$GIS_OPT_UNITS  (adjusted scale=$scale)"
-fi
-
-if [ -n "$GIS_OPT_OUTPUT" ] ; then
-    g.message "Shaded relief map created and named <$ELEVSHADE>."
-else
-    g.message "Shaded relief map created and named <$ELEVSHADE>. Consider renaming."
-fi
-
-# write cmd history:
-r.support $ELEVSHADE history="${CMDLINE}"
-
-exit 0

Deleted: grass/trunk/scripts/v.build.all/v.build.all
===================================================================
--- grass/trunk/scripts/v.build.all/v.build.all	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/v.build.all/v.build.all	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,45 +0,0 @@
-#!/bin/sh
-############################################################################
-#
-# MODULE:	v.build.all
-# AUTHOR(S):	Radim Blazek
-# PURPOSE:	Build all vectors in current mapset
-# COPYRIGHT:	(C) 2004 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-#############################################################################
-
-#%Module
-#% description: Rebuilds topology on all vector maps in the current mapset.
-#% keywords: vector
-#%End
-
-if test "$GISBASE" = ""; then
-    echo "You must be in GRASS GIS to run this program." >&2
-    exit 1
-fi
-
-# skip parser if no args are given
-if [ "$#" -gt 0 ] ; then
-  if [ "$1" != "@ARGS_PARSED@" ] ; then
-    exec g.parser "$0" "$@"
-  fi
-fi
-
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION=$GISDBASE/$LOCATION_NAME/$MAPSET
-
-
-for VECT in `g.list type=vect mapset=${MAPSET} | sed 1,2d | grep -v '^-*$'`
-do
-    g.message "Build topology for vector '${VECT}@${MAPSET}'" 
-    CMD="v.build map=${VECT}@${MAPSET}"
-    g.message "$CMD" 
-    $CMD
-done
-
-exit 0

Deleted: grass/trunk/scripts/v.centroids/v.centroids
===================================================================
--- grass/trunk/scripts/v.centroids/v.centroids	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/v.centroids/v.centroids	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,98 +0,0 @@
-#!/bin/sh
-############################################################################
-#
-# MODULE:       v.centroids
-# AUTHOR:       Hamish Bowman
-# PURPOSE:      Add missing centroids  (frontend to v.category opt=add)
-# COPYRIGHT:    (c) 2006 Hamish Bowman, and the GRASS Development Team
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-#############################################################################
-
-#%Module
-#% description: Adds missing centroids to closed boundaries.
-#% keywords: vector, centroid, area
-#%End
-
-#%option
-#% key: input
-#% type: string
-#% gisprompt: old,vector,vector
-#% key_desc: name
-#% description: Name of input vector map 
-#%required: yes
-#%end
-
-#%option
-#% key: output
-#% type: string
-#% gisprompt: new,vector,vector
-#% key_desc: name
-#% description: Name for output vector map
-#% required: yes
-#%end
-
-#%option
-#% key: option
-#% type: string
-#% description: Action to be taken
-#% options: add
-#% answer: add
-#% required: no
-#%end
-
-#%option
-#% key: layer
-#% type: integer
-#% description: Layer number
-#% answer: 1
-#% required: no
-#%end
-
-#%option
-#% key: cat
-#% type: integer
-#% description: Category number starting value
-#% answer: 1
-#% required: no
-#%end
-
-#%option
-#% key: step
-#% type: integer
-#% description: Category increment
-#% answer: 1
-#% required: no
-#%end
-
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." 1>&2
-    exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    exec g.parser "$0" "$@"
-fi
-
-
-if [ "$GIS_OPT_OPTION" = "add" ] ; then
-
-   # check we have boundaries
-   NUM_BOUND=`v.info "$GIS_OPT_INPUT" | grep "Number of boundaries:" | cut -f2 -d: | awk '{print $1}'`
-
-   if [ $NUM_BOUND -eq 0 ] ; then
-       g.message -e "Input vector map contains no boundaries."
-       exit 1
-   fi
-
-   # add centroids
-   v.category input="$GIS_OPT_INPUT" output="$GIS_OPT_OUTPUT" option=add \
-     type=area layer="$GIS_OPT_LAYER" cat="$GIS_OPT_CAT" step="$GIS_OPT_STEP"
-
-   exit $?
-fi
-
-exit 0

Deleted: grass/trunk/scripts/v.convert.all/v.convert.all
===================================================================
--- grass/trunk/scripts/v.convert.all/v.convert.all	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/v.convert.all/v.convert.all	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,65 +0,0 @@
-#!/bin/sh
-#
-############################################################################
-#
-# MODULE:	v.convert.all
-# AUTHOR(S):	MN 
-# PURPOSE:	converts all old GRASS < V5.7 vector maps to current format
-#		in current mapset
-# COPYRIGHT:	(C) 2004 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-#############################################################################
-
-#%Module
-#%  description: Convert all old GRASS < Ver5.7 vector maps in current mapset to current format
-#%  keywords: vector, import
-#%end
-#%flag
-#%  key: r
-#%  description: run non-interactively
-#%end
-
-if test "$GISBASE" = ""; then
-    echo "You must be in GRASS GIS to run this program." >&2
-    exit 1
-fi
-
-# the -r flag is a noop, just there to stop the gui coming up.
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    exec g.parser "$0" "$@"
-fi
-
-
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION=$GISDBASE/$LOCATION_NAME/$MAPSET
-
-CONVERTEDMAPS=0
-for i in `g.mlist type=oldvect`
-do
-
-  # polish map names to be SQL compliant
-  INPUT=$i
-  OUTPUT=`echo $INPUT | sed 's+\.+_+g'`
-
-  #do it:
-  v.convert in=$INPUT out=$OUTPUT
-  if [ $? -ne 0 ] ; then
-    g.message -e "Converting map $INPUT to $OUTPUT" 
-  else
-    CONVERTEDMAPS=`expr $CONVERTEDMAPS + 1`
-  fi
-done
-
-if [ $CONVERTEDMAPS -lt 1 ] ; then
-  g.message -w "No vector maps converted as no old vector maps present in current mapset <$MAPSET>."
-else
-  g.message "Total $CONVERTEDMAPS number of vector maps in current mapset converted." 
-  g.message "Please verify new vector map(s) before deleting old vector map(s)." 
-fi
-
-exit 0

Deleted: grass/trunk/scripts/v.db.addcol/v.db.addcol
===================================================================
--- grass/trunk/scripts/v.db.addcol/v.db.addcol	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/v.db.addcol/v.db.addcol	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,121 +0,0 @@
-#!/bin/sh
-#
-############################################################################
-#
-# MODULE:       v.db.addcolumn
-# AUTHOR(S):   	Moritz Lennert 
-# PURPOSE:      interface to db.execute to add a column to the attribute table
-#               connected to a given vector map
-# COPYRIGHT:    (C) 2005 by the GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-#############################################################################
-
-
-#%Module
-#%  description: Adds one or more columns to the attribute table connected to a given vector map.
-#%  keywords: vector, database, attribute table
-#%End
-
-#%option
-#% key: map
-#% type: string
-#% gisprompt: old,vector,vector
-#% key_desc : name
-#% description: Vector map for which to edit attribute table
-#% required : yes
-#%end
-
-#%option
-#% key: layer
-#% type: integer
-#% description: Layer where to add column
-#% answer: 1
-#% required : no
-#%end
-
-#%option
-#% key: columns
-#% type: string
-#% description: Name and type of the new column(s) ('name type [,name type, ...]' - types depend on database backend, but all support VARCHAR(), INT, DOUBLE PRECISION and DATE)
-#% required : yes
-#%end
-
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." >&2
-    exit 1
-fi
-
-# save command line
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    CMDLINE="`basename $0`"
-    for arg in "$@" ; do
-        CMDLINE="$CMDLINE \"$arg\""
-    done
-    export CMDLINE
-    exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-#### check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message -e "awk required, please install awk or gawk first"
-    exit 1
-fi
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-### setup enviro vars ###
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-
-# does map exist in CURRENT mapset?
-eval `g.findfile element=vector file=$GIS_OPT_MAP mapset=$MAPSET`
-if [ ! "$file" ] ; then
-   g.message "Vector map '$GIS_OPT_MAP' not found in current mapset"
-   exit 1
-fi
-
-table=`v.db.connect $GIS_OPT_MAP -g fs=";" | grep -w $GIS_OPT_LAYER | awk -F ";" '{print $2}'`
-if [ -z "$table" ] ; then
-   g.message -e 'There is no table connected to this map! Run v.db.connect or v.db.addtable first.'
-   exit 1
-fi
-
-database=`v.db.connect $GIS_OPT_MAP -g fs=";" | grep -w $GIS_OPT_LAYER | awk -F ";" '{print $4}'`
-driver=`v.db.connect $GIS_OPT_MAP -g fs=";" | grep -w $GIS_OPT_LAYER | awk -F ";" '{print $5}'`
-
-colnum=`echo $GIS_OPT_COLUMNS | awk -F, '{print NF}'`
-
-n=1
-while [ "$n" -le "$colnum" ]
-  do
-    col=`echo $GIS_OPT_COLUMNS | cut -d',' -f$n`
-    
-    if [ -z "$col" ] ; then
-      g.message -e 'There is an empty column! Did you leave a trailing comma?'
-      exit 1
-    fi
-
-    echo "ALTER TABLE $table ADD COLUMN $col" | db.execute database="${database}" driver=${driver}
-    if [ $? -eq 1 ] ; then
-      g.message -e "Cannot continue (problem adding column)."
-      exit 1
-    fi
-    n=`expr $n + 1`
-  done
-
-
-# write cmd history:
-v.support ${GIS_OPT_MAP} cmdhist="${CMDLINE}"
-
-exit 0
-

Deleted: grass/trunk/scripts/v.db.addtable/v.db.addtable
===================================================================
--- grass/trunk/scripts/v.db.addtable/v.db.addtable	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/v.db.addtable/v.db.addtable	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,196 +0,0 @@
-#!/bin/sh
-#
-############################################################################
-#
-# MODULE:       v.db.addtable
-# AUTHOR(S):   	Markus Neteler 
-# PURPOSE:      interface to db.execute to creates and add a new table to given vector map
-# COPYRIGHT:    (C) 2005, 2007  by Markus Neteler & the GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-#############################################################################
-
-#%Module
-#%  description: Creates and adds a new attribute table to a given layer of an existing vector map.
-#%  keywords: vector, database, attribute table
-#%End
-#%option
-#% key: map
-#% type: string
-#% gisprompt: old,vector,vector
-#% description: Vector map for which to add new attribute table
-#% required : yes
-#% key_desc : name
-#%end
-#%option
-#% key: table
-#% type: string
-#% description: Name of new attribute table (default: vector map name)
-#% required : no
-#%end
-#%option
-#% key: layer
-#% type: integer
-#% description: Layer where to add new attribute table
-#% answer: 1
-#% required : no
-#%end
-#%option
-#% key: columns
-#% type: string
-#% description: Name and type of the new column(s) (types depend on database backend, but all support VARCHAR(), INT, DOUBLE PRECISION and DATE)
-#% answer: cat integer
-#% required : no
-#% multiple : yes
-#% key_desc : name type
-#%end
-
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." 1>&2
- exit 1
-fi
-
-# save command line
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    CMDLINE="`basename $0`"
-    for arg in "$@" ; do
-        CMDLINE="$CMDLINE \"$arg\""
-    done
-    export CMDLINE
-    exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-#### check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message -e "awk required, please install awk or gawk first"
-    exit 1
-fi
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-### setup enviro vars ###
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION="$GISDBASE/$LOCATION_NAME/$MAPSET"
-
-# does map exist in CURRENT mapset?
-eval `g.findfile element=vector file="$GIS_OPT_MAP" mapset="$MAPSET"`
-MAP_MAPSET=`echo "$GIS_OPT_MAP" | grep '@' | cut -f2 -d'@'`
-if [ -z "$MAP_MAPSET" ] ; then
-   MAP_MAPSET="$MAPSET"
-fi
-if [ ! "$file" ] || [ "$MAP_MAPSET" != "$MAPSET" ] ; then
-   g.message -e  "Vector map <$GIS_OPT_MAP> not found in current mapset"
-   exit 1
-else
-   MAP_NAME=`echo "$GIS_OPT_MAP" | cut -f1 -d'@'` 
-fi
-
-
-if [ -z "$GIS_OPT_TABLE" ] ; then
-    if [ $GIS_OPT_LAYER -eq 1 ] ; then
-       g.message "Using vector map name as table name: $MAP_NAME" 
-       table="$MAP_NAME"
-    else
-       # two avoid tables with identical names on higher layers
-       g.message "Using vector map name extended by layer number as table name: ${MAP_NAME}_$GIS_OPT_LAYER" 
-       table="${MAP_NAME}_$GIS_OPT_LAYER"
-    fi
-else
-    g.message "Using user specified table name: $GIS_OPT_TABLE"
-    table="$GIS_OPT_TABLE"
-fi
-
-# we use the DB settings of layer 1 to find out default connection
-QUERYLAYER=1
-
-# check if DB parameters are set, and if not set them.
-db.connect -c
-
-#check if anything is connected:
-v.db.connect map="$GIS_OPT_MAP" -g  2> /dev/null | grep '^1 ' > /dev/null
-if [ $? -ne 0 ] ; then
-   # nothing defined for layer 1
-   g.message "Creating new DB connection based on default mapset settings..."
-   database=`db.connect -p | grep '^database' | cut -d':' -f2`
-   driver=`db.connect -p | grep '^driver' | cut -d':' -f2`
-else
-   # there is a definition for layer 1, so we check for the user defined layer
-   database=`v.db.connect map="$GIS_OPT_MAP" -g fs=";" | grep -w "$QUERYLAYER" | awk -F ";" '{print $4}'`
-   if [ -z "database" ] ; then
-      #nothing on user defined layer, so we use the default mapset settings in this case:
-      database=`db.connect -p | grep '^database' | cut -d':' -f2`
-      driver=`db.connect -p | grep '^driver' | cut -d':' -f2`
-   else
-      driver=`v.db.connect map="$GIS_OPT_MAP" -g fs=";" | grep -w "$QUERYLAYER" | awk -F ";" '{print $5}'`
-   fi
-fi
-
-#maybe there is already a table linked to the selected layer?
-if [ "$GIS_OPT_LAYER" -eq 1 ] ; then
-  v.db.connect "$GIS_OPT_MAP" -g 2> /dev/null | grep -w "$GIS_OPT_LAYER" > /dev/null
-  if [ $? -eq 0 ] ; then
-     g.message -e "There is already a table linked to layer <$GIS_OPT_LAYER>" 
-     exit 1
-  fi
-fi
-
-#maybe there is already a table with that name?
-db.tables database="$database" driver="$driver" 2> /dev/null | grep "^$table$"
-if [ $? -ne 0 ] ; then
-   #if not existing, create it:
-
-   if [ "$GIS_OPT_COLUMNS" = "cat integer" ] ; then
-      COLUMN_DEF="cat integer"
-   else
-      COLUMN_DEF=`echo "cat integer, $GIS_OPT_COLUMNS" | sed \
-	-e 's/cat integer, cat integer,/cat integer, /' \
-	-e 's/cat integer, cat INTEGER,/cat integer, /' \
-	-e 's/cat integer, cat int,/cat integer, /' \
-	-e 's/cat integer, cat INT,/cat integer, /'`
-   fi
-   g.message "Creating table with columns ($COLUMN_DEF)"
-
-   # take care if the DBF directory is missing (heck, the DBF driver should take care!)
-   if [ "$driver" = "dbf" ] ; then
-       if test ! -d "${LOCATION}/dbf" ; then
-          g.message "Creating missing DBF directory in MAPSET <$MAPSET>"
-          mkdir -p "${LOCATION}/dbf"
-          db.connect driver=dbf database='$GISDBASE/$LOCATION_NAME/$MAPSET/dbf/'
-       fi
-   fi
-
-   echo "CREATE TABLE $table ($COLUMN_DEF)" | db.execute database="$database" driver="$driver"
-   if [ $? -ne 0 ] ; then
-     g.message -e "Cannot continue."
-     exit 1
-   fi
-fi
-
-# connect the map to the DB:
-v.db.connect map="$GIS_OPT_MAP" database="${database}" driver="$driver" \
-   layer="$GIS_OPT_LAYER" table="$table" key=cat
-
-# finally we have to add cats into the attribute DB to make modules such as v.what.rast happy:
-# (creates new row for each vector line):
-v.to.db "$GIS_OPT_MAP" layer="$GIS_OPT_LAYER" option=cat col=cat
-
-if [ -z "$GRASS_VERBOSE" ] || [ "$GRASS_VERBOSE" -gt 0 ] ; then
-   g.message "Current attribute table links:"
-   v.db.connect -p "$GIS_OPT_MAP"
-fi
-
-# write cmd history:
-v.support map="$GIS_OPT_MAP" cmdhist="${CMDLINE}"
-
-exit 0
-

Deleted: grass/trunk/scripts/v.db.dropcol/v.db.dropcol
===================================================================
--- grass/trunk/scripts/v.db.dropcol/v.db.dropcol	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/v.db.dropcol/v.db.dropcol	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,163 +0,0 @@
-#!/bin/sh
-
-############################################################################
-#
-# MODULE:       v.db.dropcolumn
-# AUTHOR(S):    Markus Neteler
-# PURPOSE:      interface to db.execute to drop a column from the 
-#               attribute table connected to a given vector map
-#               - Based on v.db.addcol
-#               - with special trick for SQLite
-# COPYRIGHT:    (C) 2007 by the GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-#############################################################################
-
-
-#%Module
-#%  description: Drops a column from the attribute table connected to a given vector map.
-#%  keywords: vector, database, attribute table
-#%End
-
-#%option
-#% key: map
-#% type: string
-#% gisprompt: old,vector,vector
-#% key_desc : name
-#% description: Vector map for which to drop attribute column
-#% required : yes
-#%end
-
-#%option
-#% key: layer
-#% type: integer
-#% description: Layer where to drop column
-#% answer: 1
-#% required : no
-#%end
-
-#%option
-#% key: column
-#% type: string
-#% description: Name of the column
-#% required : yes
-#%end
-
-
-if  [ -z "$GISBASE" ] ; then
-    echo 'You must be in GRASS GIS to run this program' >&2
- exit 1
-fi
-
-# save command line
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    CMDLINE="`basename $0`"
-    for arg in "$@" ; do
-        CMDLINE="$CMDLINE \"$arg\""
-    done
-    export CMDLINE
-    exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-#### setup temporary file
-TMP="`g.tempfile pid=$$`"
-if [ $? -ne 0 ] || [ -z "$TMP" ] ; then
-    g.message -e 'Unable to create temporary files'
-    exit 1
-fi
-
-cleanup()
-{
- \rm -f "$TMP" "$TMP.coltypes" "$TMP.colnames" "$TMP.coldesc"
-}
-
-# what to do in case of user break:
-exitprocedure()
-{
- g.message -e 'User break!'
- cleanup
- exit 1
-}
-# shell check for user break (signal list: trap -l)
-trap "exitprocedure" 2 3 15
-
-### setup enviro vars ###
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-
-# does map exist in CURRENT mapset?
-eval `g.findfile element=vector file=$GIS_OPT_MAP mapset=$MAPSET`
-if [ ! "$file" ] ; then
-   g.message -e "Vector map <$GIS_OPT_MAP> not found in current mapset"
-   exit 1
-fi
-
-table=`v.db.connect map=$GIS_OPT_MAP -g fs=";" | grep -w $GIS_OPT_LAYER | cut -f2 -d";"`
-if [ -z "$table" ] ; then
-   g.message -e 'There is no table connected to the input vector map! Cannot delete any column'
-   cleanup
-   exit 1
-fi
-keycol=`v.db.connect -g fs=";" map=$GIS_OPT_MAP | grep -w $GIS_OPT_LAYER | cut -f3 -d';'`
-database=`v.db.connect -g fs=";" map=$GIS_OPT_MAP | grep -w $GIS_OPT_LAYER | cut -f4 -d';'`
-driver=`v.db.connect -g fs=";" map=$GIS_OPT_MAP | grep -w $GIS_OPT_LAYER | cut -f5 -d';'`
-col="$GIS_OPT_COLUMN"
-
-if [ "$col" = "$keycol" ] ; then
-   g.message -e "Cannot delete <$col> column as it is needed to keep table\
-      <$table> connected to the input vector map <$GIS_OPT_MAP>"
-   cleanup
-   exit 1
-fi
-
-v.info --q -c map=$GIS_OPT_MAP layer=$GIS_OPT_LAYER | cut -d'|' -f1,2 | grep "|${col}$" 2>&1 >/dev/null
-if [ $? -ne 0 ] ; then
-	g.message -e "Column <$col> not found in table <$table>"
-	cleanup
-	exit 1
-fi
-
-if [ "$driver" = "sqlite" ] ; then
-	#echo "Using special trick for SQLite"
-	# http://www.sqlite.org/faq.html#q13
-	v.info --q -c map=$table | cut -d'|' -f1,2 | grep -v "|${col}$" > "$TMP.coldesc"
-	# need to revert order:
-	cat "$TMP.coldesc" | cut -d'|' -f1 > "$TMP.coltypes"
-	cat "$TMP.coldesc" | cut -d'|' -f2 > "$TMP.colnames"
-	COLDEF=`paste -d' ' "$TMP.colnames" "$TMP.coltypes" | tr '\n' ',' | sed 's+,$++g'`
-	COLNAMES=`cat "$TMP.colnames" | tr '\n' ',' | sed 's+,$++g'`
-echo "BEGIN TRANSACTION;
-CREATE TEMPORARY TABLE ${table}_backup(${COLDEF});
-INSERT INTO ${table}_backup SELECT ${COLNAMES} FROM ${table};
-DROP TABLE ${table};
-CREATE TABLE ${table}(${COLDEF});
-INSERT INTO ${table} SELECT ${COLNAMES} FROM ${table}_backup;
-DROP TABLE ${table}_backup;
-COMMIT;" > "$TMP"
-	db.execute input="$TMP"
-	if [ $? -eq 1 ] ; then
-	    	g.message -e 'Cannot continue (problem deleting column)'
-	    	cleanup
-	    	exit 1
-	fi
-else
-	echo "ALTER TABLE $table DROP COLUMN $col" | db.execute database="${database}" driver=${driver}
-	if [ $? -eq 1 ] ; then
-	    	g.message -e 'Cannot continue (problem deleting column)'
-	    	cleanup
-	    	exit 1
-	fi
-fi
-
-# cleanup
-cleanup
-
-# write cmd history:
-v.support map=${GIS_OPT_MAP} cmdhist="${CMDLINE}"
-
-exit 0

Deleted: grass/trunk/scripts/v.db.droptable/v.db.droptable
===================================================================
--- grass/trunk/scripts/v.db.droptable/v.db.droptable	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/v.db.droptable/v.db.droptable	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,141 +0,0 @@
-#!/bin/sh
-#
-############################################################################
-#
-# MODULE:       v.db.droptable
-# AUTHOR(S):   	Markus Neteler 
-# PURPOSE:      interface to db.execute to drop an existing table of given vector map
-# COPYRIGHT:    (C) 2005 by the GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-#############################################################################
-
-
-#%Module
-#%  description: Removes existing attribute table of a vector map.
-#%  keywords: vector, database, attribute table
-#%End
-#%flag
-#%  key: f
-#%  description: Force removal (required for actual deletion of table)
-#%end
-#%option
-#% key: map
-#% type: string
-#% gisprompt: old,vector,vector
-#% description: Vector map from which to remove attribute table
-#% required : yes
-#%end
-#%option
-#% key: table
-#% type: string
-#% description: Name of existing attribute table (default: vector map name)
-#% required : no
-#%end
-#%option
-#% key: layer
-#% type: integer
-#% description: Layer from which to drop linked attribute table
-#% answer: 1
-#% required : no
-#%end
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." 1>&2
- exit 1
-fi
-
-# save command line
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    CMDLINE="`basename $0`"
-    for arg in "$@" ; do
-        CMDLINE="$CMDLINE \"$arg\""
-    done
-    export CMDLINE
-    exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-#### check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message -e "awk required, please install awk/gawk first" 
-    exit 1
-fi
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-# do some paranoia tests as well:
-if [ -z "$GIS_OPT_TABLE" ] ; then
-    table=`v.db.connect map="$GIS_OPT_MAP" -g`
-    if [ $? -ne 0 ] ; then
-       g.message -e "An error occured while running v.db.connect"
-       exit 1
-    fi
-    table=`v.db.connect map="$GIS_OPT_MAP" -g fs=";" | grep -w "$GIS_OPT_LAYER" | awk -F ";" '{print $2}'`
-    if [ -z $table ] ; then
-       g.message -e "No table assigned to layer <$GIS_OPT_LAYER>"
-       exit 1
-    fi
-    # Removing table name connected to selected layer
-else
-    # Removing user specified table
-    existingtable=`v.db.connect map="$GIS_OPT_MAP" -g fs=";" | grep -w "$GIS_OPT_LAYER" | awk -F ";" '{print $2}'`
-    table=$GIS_OPT_TABLE
-    if [ "$existingtable" != "$table" ] ; then
-       g.message -e "User selected table <$table> but the table <$existingtable> is linked to layer <$GIS_OPT_LAYER>" 
-       exit 1
-    fi		  
-fi
-
-# we use the DB settings selected layer 
-database=`v.db.connect map="$GIS_OPT_MAP" -g`
-if [ $? -ne 0 ] ; then
-   g.message -e "An error occured while running v.db.connect" 
-   exit 1
-fi
-database=`v.db.connect map="$GIS_OPT_MAP" -g fs=";" | grep -w "$GIS_OPT_LAYER" | awk -F ";" '{print $4}'`
-driver=`v.db.connect map="$GIS_OPT_MAP" -g fs=";" | grep -w "$GIS_OPT_LAYER" | awk -F ";" '{print $5}'`
-
-g.message "Removing table <$table> linked to layer <$GIS_OPT_LAYER> of vector map <$GIS_OPT_MAP>" 
-
-if [ $GIS_FLAG_f -eq 0 ] ; then
-   g.message "You must use the force flag to actually remove the table. Exiting."
-   exit 0
-else
-   ans="y"
-fi
-
-if [ "$ans" = "y" -o "$ans" = "Y" ] ; then
-   g.message "Dropping table <$table>..."
-   echo "DROP TABLE $table" | db.execute
-   if [ $? -ne 0 ] ; then
-      g.message -e "An error occured while running db.execute"
-      exit 1
-   fi
-
-   v.db.connect -d map="$GIS_OPT_MAP" layer="$GIS_OPT_LAYER"
-
-   g.message "Current attribute table link(s):" 
-   # silently test first to avoid confusing error messages
-   v.db.connect --quiet -p map="$GIS_OPT_MAP" > /dev/null 2> /dev/null
-   if [ $? -ne 0 ] ; then
-      g.message "(No database links remaining)"
-   else
-     v.db.connect -p map="$GIS_OPT_MAP"
-   fi
-
-   # write cmd history:
-   v.support "${GIS_OPT_MAP}" cmdhist="${CMDLINE}"
-
-else
-   g.message "Leaving map/table unchanged." 
-fi
-
-exit 0

Deleted: grass/trunk/scripts/v.db.join/v.db.join
===================================================================
--- grass/trunk/scripts/v.db.join/v.db.join	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/v.db.join/v.db.join	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,124 +0,0 @@
-#!/bin/sh
-
-############################################################################
-#
-# MODULE:       v.db.join
-# AUTHOR(S):    Markus Neteler
-# PURPOSE:      Join a table to a map table
-# COPYRIGHT:    (C) 2007-2008 by Markus Neteler and the GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-#############################################################################
-
-#%Module
-#% description: Allows to join a table to a vector map table.
-#% keywords: vector, database, attribute table
-#%End
-
-#%option
-#% key: map
-#% type: string
-#% key_desc : name
-#% gisprompt: old,vector,vector
-#% description: Vector map to which to join other table
-#% required : yes
-#%end
-
-#%option
-#% key: layer
-#% type: integer
-#% description: Layer where to join
-#% answer: 1
-#% required : no
-#% gisprompt: old_layer,layer,layer
-#%end
-
-#%option
-#% key: column
-#% type: string
-#% description: Join column in map table
-#% required : yes
-#% gisprompt: old_dbcolumn,dbcolumn,dbcolumn
-#%end
-
-#%option
-#% key: otable
-#% type: string
-#% description: Other table name
-#% required : yes
-#% gisprompt: old_dbtable,dbtable,dbtable
-#%end
-
-#%option
-#% key: ocolumn
-#% type: string
-#% description: Join column in other table
-#% required : yes
-#% gisprompt: old_dbcolumn,dbcolumn,dbcolumn
-#%end
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." >&2
- exit 1
-fi
-
-# save command line
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    CMDLINE="`basename $0`"
-    for arg in "$@" ; do
-        CMDLINE="$CMDLINE \"$arg\""
-    done
-    export CMDLINE
-    exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-driver=`v.db.connect -g map="$GIS_OPT_MAP" fs=";" | grep "^$GIS_OPT_LAYER" | cut -d';' -f5`
-database=`v.db.connect -g map="$GIS_OPT_MAP" fs=";" | grep "^$GIS_OPT_LAYER" | cut -d';' -f4`
-
-if [ "$driver" = "dbf" ] ; then
-   g.message -e "JOIN is not supported for tables stored in DBF format."
-   exit 1
-fi
-
-maptable=`v.db.connect -g map="$GIS_OPT_MAP" fs=";" | grep "^$GIS_OPT_LAYER" | cut -d';' -f2`
-
-if [ -z "$maptable" ] ; then
-   g.message 'There is no table connected to this map! Cannot join any column.'
-   ### cleanup
-   exit 1
-fi
-
-v.info --quiet -c "$GIS_OPT_MAP" layer="$GIS_OPT_LAYER" | \
-    cut -d'|' -f1,2 | grep "|${GIS_OPT_COLUMN}$" 2>&1 >/dev/null
-
-if [ $? -ne 0 ] ; then
-    g.message -e "Column <$GIS_OPT_COLUMN> not found in table <$GIS_OPT_MAP> at layer $GIS_OPT_LAYER"
-    exit 1
-fi
-
-# we use map DBMI settings
-COLLIST=`db.describe  -c driver="$driver" database="$database" table="$GIS_OPT_OTABLE" | grep '^Column ' | cut -d':' -f2`
-# heck, types may have white space
-COLTYPES=`db.describe -c driver="$driver" database="$database" table="$GIS_OPT_OTABLE" | grep '^Column ' | cut -d':' -f3 | tr -s ' ' '_'`
-
-i=1
-for col in $COLLIST ; do
-  v.db.addcol "$GIS_OPT_MAP" layer="$GIS_OPT_LAYER" col="$col `echo $COLTYPES | cut -d' ' -f$i | tr -s '_' ' '`"
-  if [ $? -ne 0 ] ; then
-	g.message -e "Cannot continue."
-	exit 1
-  fi
-  echo "UPDATE $maptable SET $col=(SELECT $col
-        FROM $GIS_OPT_OTABLE WHERE $GIS_OPT_OTABLE.$GIS_OPT_OCOLUMN=$maptable.$GIS_OPT_COLUMN);" | db.execute database="${database}" driver=${driver}
-  i=`expr $i + 1`
-done
-
-# write cmd history:
-v.support "${GIS_OPT_MAP}" cmdhist="${CMDLINE}"
-
-exit 0

Deleted: grass/trunk/scripts/v.db.reconnect.all/v.db.reconnect.all
===================================================================
--- grass/trunk/scripts/v.db.reconnect.all/v.db.reconnect.all	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/v.db.reconnect.all/v.db.reconnect.all	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,103 +0,0 @@
-#!/bin/sh
-############################################################################
-#
-# MODULE:	v.db.reconnect.all
-# AUTHOR(S):	Radim Blazek
-# PURPOSE:	Reconnect vectors
-# COPYRIGHT:	(C) 2004 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-#############################################################################
-
-#%Module
-#% description: Reconnects vectors to a new database.
-#% keywords: vector, database, attribute table
-#%End
-#%option
-#% key: old_database
-#% type: string
-#% description: Name of old database. The database must be in form printed by v.db.connect -g, i.e. with substituted variables
-#% required : yes
-#%END
-#%option
-#% key: new_database
-#% type: string
-#% description: Name of new database
-#% required : yes
-#%END
-#%option
-#% key: old_schema
-#% type: string
-#% description: Old schema
-#% required : no
-#%END
-#%option
-#% key: new_schema
-#% type: string
-#% description: New schema
-#% required : no
-#%END
-
-if test "$GISBASE" = ""; then
-    echo "You must be in GRASS GIS to run this program." >&2
-    exit 1
-fi
-
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION=$GISDBASE/$LOCATION_NAME/$MAPSET
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-   exec g.parser "$0" "$@"
-fi
-
-OLD_DATABASE=$GIS_OPT_OLD_DATABASE
-NEW_DATABASE=$GIS_OPT_NEW_DATABASE
-OLD_SCHEMA=$GIS_OPT_OLD_SCHEMA
-NEW_SCHEMA=$GIS_OPT_NEW_SCHEMA
-
-if [ -z "$OLD_DATABASE" ] ; then
-  g.message -e "Old database not specified"
-  exit 1
-fi
-
-if [ -z "$NEW_DATABASE" ] ; then
-  g.message -e "New database not specified"
-  exit 1
-fi
-
-for VECT in `g.list type=vect mapset=${MAPSET} | sed 1,2d | grep -v '^-*$'`
-do
-    g.message message="Reconnecting vector '${VECT}@${MAPSET}'"
-    for LINK in `v.db.connect -g fs=";" map=${VECT}@${MAPSET} | tr ';' '|'`
-    do
-        eval `echo $LINK | sed 's$\([^\|]*\)|\([^\|]*\)|\([^\|]*\)|\([^\|]*\)|\([^\|]*\)$LAYER=\1 SCHEMA_TABLE=\2 KEY=\3 DATABASE=\4 DRIVER=\5$'`
-
-        SCHEMA=`echo $SCHEMA_TABLE | grep '\.' | sed 's/\([^.]*\)\..*/\1/'`
-        TABLE=`echo $SCHEMA_TABLE | sed 's/.*\.//'`
-
-        if [ -n "$NEW_SCHEMA" ] ; then
-            NEW_SCHEMA_TABLE="${NEW_SCHEMA}.${TABLE}"
-        else
-            NEW_SCHEMA_TABLE="${TABLE}"
-        fi
-
-        g.message message="SCHEMA = $SCHEMA TABLE = $TABLE NEW_SCHEMA_TABLE=$NEW_SCHEMA_TABLE"
-
-        if [ "$DATABASE" = "$OLD_DATABASE" -a "$SCHEMA" = "$OLD_SCHEMA" ]
-	then
-	   g.message "    Reconnecting layer $LAYER"
-	   CMD="v.db.connect -o map=${VECT}@${MAPSET} layer=$LAYER driver=$DRIVER database=${NEW_DATABASE} table=$NEW_SCHEMA_TABLE key=$KEY"
-	   g.message message="$CMD"
-	   $CMD
-	else 
-	   g.message "Layer $LAYER will not be reconnected, database or schema do not match."
-	fi
-    done
-done
-
-exit 0
-

Deleted: grass/trunk/scripts/v.db.renamecol/v.db.renamecol
===================================================================
--- grass/trunk/scripts/v.db.renamecol/v.db.renamecol	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/v.db.renamecol/v.db.renamecol	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,169 +0,0 @@
-#!/bin/sh
-#
-############################################################################
-#
-# MODULE:       v.db.renamecol
-# AUTHOR(S):    Markus Neteler
-# PURPOSE:      interface to db.execute to drop a column from the 
-#               attribute table connected to a given vector map
-#               - Based on v.db.dropcol
-#               - with special trick for SQLite and DBF (here the new col is 
-#                 added/values copied/old col deleted)
-# COPYRIGHT:    (C) 2007 by the GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-# TODO: MySQL untested
-#############################################################################
-
-
-#%Module
-#%  description: Renames a column in the attribute table connected to a given vector map.
-#%  keywords: vector, database, attribute table
-#%End
-#%option
-#% key: map
-#% type: string
-#% gisprompt: old,vector,vector
-#% key_desc : name
-#% description: Vector map for which to rename attribute column
-#% required : yes
-#%end
-#%option
-#% key: layer
-#% type: integer
-#% description: Layer where to rename column
-#% answer: 1
-#% required : no
-#%end
-#%option
-#% key: column
-#% type: string
-#% description: Old and new name of the column (old,new)
-#% required : yes
-#% multiple: yes
-#%end
-
-if [ -z "$GISBASE" ] ; then
-    echo 'You must be in GRASS GIS to run this program' >&2
-    exit 1
-fi
-
-# save command line
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    CMDLINE="`basename $0`"
-    for arg in "$@" ; do
-        CMDLINE="$CMDLINE \"$arg\""
-    done
-    export CMDLINE
-    exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-#### setup temporary file
-TMP="`g.tempfile pid=$$`"
-if [ $? -ne 0 ] || [ -z "$TMP" ] ; then
-    g.message -e 'Unable to create temporary files'
-    exit 1
-fi
-
-cleanup()
-{
- \rm -f "$TMP" "$TMP.coltypes" "$TMP.colnames" "$TMP.coldesc"
-}
-
-# what to do in case of user break:
-exitprocedure()
-{
- g.message -e 'User break!'
- cleanup
- exit 1
-}
-# shell check for user break (signal list: trap -l)
-trap "exitprocedure" 2 3 15
-
-error()
-{
-  g.message -e 'Cannot continue (problem renaming column)'
-  cleanup
-  exit 1
-}
-
-### setup enviro vars ###
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-# does map exist in CURRENT mapset?
-eval `g.findfile element=vector file="$GIS_OPT_MAP" mapset="$MAPSET"`
-if [ ! "$file" ] ; then
-   g.message -e  "Vector map <$GIS_OPT_MAP> not found in current mapset"
-   exit 1
-fi
-
-table=`v.db.connect -g map="$GIS_OPT_MAP" fs=";" | grep -w "$GIS_OPT_LAYER" | cut -f2 -d';'`
-if [ -z "$table" ] ; then
-   g.message -e 'There is no table connected to the input vector map! Cannot rename any column'
-   cleanup
-   exit 1
-fi
-
-keycol=`v.db.connect -g map="$GIS_OPT_MAP" fs=";" | grep -w $GIS_OPT_LAYER | cut -f3 -d';'`
-database=`v.db.connect -g map="$GIS_OPT_MAP" fs=";" | grep -w $GIS_OPT_LAYER | cut -f4 -d';'`
-driver=`v.db.connect -g map="$GIS_OPT_MAP" fs=";" | grep -w $GIS_OPT_LAYER | cut -f5 -d';'`
-oldcol="`echo $GIS_OPT_COLUMN | cut -d',' -f1`"
-newcol="`echo $GIS_OPT_COLUMN | cut -d',' -f2`"
-
-if [ "$driver" = "dbf" ] ; then
-  NAMELEN=`echo "$newcol" | wc -c`
-  #max DBF column name length is 10, but wc counts echo's \n char so we test for 11.
-  #  'echo -n' (output as string, ie with no newline) is apparently not portable.
-  if [ "$NAMELEN" -gt 11 ] ; then
-   g.message -e "Column name <$newcol> too long. The DBF driver supports column names\
-    not longer than 10 characters"
-   cleanup
-   exit 1
-  fi
-fi
-
-if [ "$oldcol" = "$keycol" ] ; then
-   g.message -e "Cannot rename column <$oldcol> as it is needed to keep table <$table>\
-     connected to the input vector map"
-   cleanup
-   exit 1
-fi
-
-# old col there?
-v.info --quiet -c map="$GIS_OPT_MAP" layer=$GIS_OPT_LAYER | cut -d'|' -f1,2 | grep "|${oldcol}$" 2>&1 >/dev/null
-if [ $? -ne 0 ] ; then
-	g.message -e "Column <$oldcol> not found in table"
-	cleanup
-	exit 1
-fi
-
-# describe old col
-oldcoltype="`db.describe -c table=$table database=$database driver=$driver | grep $oldcol | cut -d':' -f3`"
-oldcollength=`db.describe -c table=$table database=$database driver=$driver | grep $oldcol | cut -d':' -f4`
-
-# some tricks
-if [ "$driver" = "sqlite" -o "$driver" = "dbf" ] ; then
-
-	if [ "$oldcoltype" = "CHARACTER" ] ; then
-	    v.db.addcol map="$GIS_OPT_MAP" layer=$GIS_OPT_LAYER col="$newcol varchar($oldcollength)" || error
-	else
-	    v.db.addcol map="$GIS_OPT_MAP" layer=$GIS_OPT_LAYER col="$newcol $oldcoltype" || error
-	fi
-	echo "UPDATE $table SET $newcol=$oldcol" | db.execute database="${database}" driver=${driver}
-	v.db.dropcol map="$GIS_OPT_MAP" layer=$GIS_OPT_LAYER col=$oldcol
-else
-	echo "ALTER TABLE $table RENAME $oldcol TO $newcol" | db.execute database="${database}" driver=${driver} || error
-fi
-
-# cleanup
-cleanup
-
-# write cmd history:
-v.support map="${GIS_OPT_MAP}" cmdhist="${CMDLINE}"
-
-exit 0

Deleted: grass/trunk/scripts/v.db.univar/v.db.univar
===================================================================
--- grass/trunk/scripts/v.db.univar/v.db.univar	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/v.db.univar/v.db.univar	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,212 +0,0 @@
-#!/bin/sh
-
-############################################################################
-#
-# MODULE:	v.db.univar (formerly called v.univar.sh)
-# AUTHOR(S):	Michael Barton, Arizona State University
-# PURPOSE:	Calculates univariate statistics from a GRASS vector map attribute column.
-#               Based on r.univar.sh by Markus Neteler
-# COPYRIGHT:	(C) 2005, 2007 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-#############################################################################
-
-#%Module
-#% description: Calculates univariate statistics on selected table column for a GRASS vector map.
-#% keywords: vector, statistics
-#%End
-#%flag
-#%  key: e
-#%  description: Extended statistics (quartiles and 90th percentile)
-#%END
-#%option
-#% key: table
-#% type: string
-#% gisprompt: old,vector,vector
-#% description: Name of data table
-#% required : yes
-#%End
-#%option
-#% key: column
-#% type: string
-#% description: Column on which to calculate statistics (must be numeric)
-#% required : yes
-#%end
-#%option
-#% key: database
-#% type: string
-#% description: Database/directory for table
-#% required : no
-#%end
-#%option
-#% key: driver
-#% type: string
-#% description: Database driver
-#% required : no
-#%end
-#%option
-#% key: where
-#% type: string
-#% description: WHERE conditions of SQL statement without 'where' keyword
-#% required : no
-#%end
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." 1>&2
- exit 1
-fi   
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-  exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-#### check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message -e "awk required, please install awk/gawk first"
-    exit 1
-fi
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-
-TMP="`g.tempfile pid=$$`"
-if [ $? -ne 0 ] || [ -z "$TMP" ] ; then
-    g.message -e "Unable to create temporary files"
-    exit 1
-fi
-
-cleanup()
-{
-   \rm -f "$TMP" "$TMP.sort"
-}
-
-# what to do in case of user break:
-exitprocedure()
-{
- g.message -e 'User break!'
- cleanup
- exit 1
-}
-# shell check for user break (signal list: trap -l)
-trap "exitprocedure" 2 3 15
-
-
-g.message "Calculation for column $GIS_OPT_COLUMN of table $GIS_OPT_TABLE..."
-g.message "Reading column values..."
-
-if [ -z "$GIS_OPT_DATABASE" ] ; then
-    db=""
-else
-    db="database=$GIS_OPT_DATABASE"
-fi
-
-if [ -z "$GIS_OPT_DRIVER" ] ; then
-    drv=""
-else
-    drv="driver=$GIS_OPT_DRIVER"
-fi
-
-if [ -z "$GIS_OPT_WHERE" ] ; then
-   db.select table="$GIS_OPT_TABLE" $db $drv sql="select $GIS_OPT_COLUMN from $GIS_OPT_TABLE" -c > "$TMP"
-else
-   db.select table="$GIS_OPT_TABLE" $db $drv sql="select $GIS_OPT_COLUMN from $GIS_OPT_TABLE WHERE $GIS_OPT_WHERE" -c > "$TMP"
-fi
-
-
-# debug:
-#echo "database = $GIS_OPT_DATABASE"
-#echo "db = $db"
-#echo ""
-#echo "drv = $drv"
-#echo "driver = $GIS_OPT_DRV"
-#echo ""
-
-#check if map contains only NULL's in current region
-LINES=`wc -l "$TMP" | awk '{print $1}'`
-if [ "$LINES" -eq 0 ] ; then
- g.message -e "Table $GIS_OPT_TABLE contains no data." 
- cleanup
- exit 1
-fi
-
-# calculate statistics
-g.message "Calculating statistics..."
-cat "$TMP" | awk 'BEGIN {sum = 0.0 ; sum2 = 0.0; min = 10e10 ; max = -min}
-function abs(x){return x < 0 ? -x : x}
-(NF>0) {
-	sum += $1 ; sum2 += $1 * $1 ; sum3 += abs($1) ; N++;
-        if ($1 > max) {max = $1}
-        if ($1 < min) {min = $1}
-       }
-END{
-    if(N>0){
-	print ""
-	print "Number of values:",N
-	print "Minimum:",min
-	print "Maximum:",max
-	print "Range:",max-min
-	print "-----"
-	print "Mean:",sum/N
-	print "Arithmetic mean of absolute values:",sum3/N
-	print "Variance:",(sum2 - sum*sum/N)/N
-	print "Standard deviation:",sqrt((sum2 - sum*sum/N)/N)
-	print "Coefficient of variation:",(sqrt((sum2 - sum*sum/N)/N))/(sqrt(sum*sum)/N)
-	print "-----"
-    }else{
-	print "ERROR: No non-null values found"
-    }
-}'
-
-if [ $GIS_FLAG_E -eq 1 ] ; then
-  #preparations:
-  cat "$TMP" | sort -n > "$TMP.sort"
-  NUMBER=`cat "$TMP.sort" | wc -l | awk '{print $1}'`
-  ODDEVEN=`echo $NUMBER | awk '{print $1%2}'`
-
-  # 0.25 quartile
-  QUARTILE=0.25
-  QPOS=`echo $NUMBER $QUARTILE | awk '{printf "%d", $1 * $2 + 0.5}'`
-  QELEMENT=`head -n $QPOS "$TMP.sort" | tail -n 1`
-  echo "1st Quartile: $QELEMENT"
-
-  #Calculate median
-  if [ $ODDEVEN -eq 0 ]
-  then
-   # even
-   EVENMEDIANNUMBER=`expr $NUMBER / 2`
-   EVENMEDIANNUMBERPLUSONE=`expr $EVENMEDIANNUMBER + 1`
-   # select two numbers
-   SELECTEDNUMBERS=`cat "$TMP.sort" | head -n $EVENMEDIANNUMBERPLUSONE | tail -n 2`
-   RESULTEVENMEDIAN=`echo $SELECTEDNUMBERS | awk '{printf "%f", ($1 + $2)/2.0}'`
-   echo "Median (even N): $RESULTEVENMEDIAN"
-  else
-   # odd
-   ODDMEDIANNUMBER=`echo $NUMBER | awk '{printf "%d", int($1/2+.5)}'`
-   RESULTODDMEDIAN=`cat "$TMP.sort" | head -n $ODDMEDIANNUMBER | tail -n 1 | awk '{printf "%f", $1}'`
-   echo "Median (odd N): $RESULTODDMEDIAN"
-  fi
-
-
-  # 0.75 quartile
-  QUARTILE=0.75
-  QPOS=`echo $NUMBER $QUARTILE | awk '{printf "%d", $1 * $2 + 0.5}'`
-  QELEMENT=`head -n $QPOS "$TMP.sort" | tail -n 1`
-  echo "3rd Quartile: $QELEMENT"
-
-  # 0.90 percentile
-  QUARTILE=0.9
-  QPOS=`echo $NUMBER $QUARTILE | awk '{printf "%d", $1 * $2 + 0.5}'`
-  QELEMENT=`head -n $QPOS "$TMP.sort" | tail -n 1`
-  echo "90th Percentile: $QELEMENT"
-
-fi
-
-cleanup

Deleted: grass/trunk/scripts/v.db.update/v.db.update
===================================================================
--- grass/trunk/scripts/v.db.update/v.db.update	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/v.db.update/v.db.update	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,139 +0,0 @@
-#!/bin/sh
-#
-############################################################################
-#
-# MODULE:       v.db.update
-# AUTHOR(S):    Moritz Lennert
-#               extensions by Markus Neteler
-# PURPOSE:      interface to db.execute to update a column in the attribute table connected to a given map
-# COPYRIGHT:    (C) 2005,2007 by the GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-#############################################################################
-
-#%Module
-#%  description: Allows to update a column in the attribute table connected to a vector map.
-#%  keywords: vector, database, attribute table
-#%End
-#%option
-#% key: map
-#% type: string
-#% gisprompt: old,vector,vector
-#% description: Vector map to edit the attribute table for
-#% required : yes
-#%end
-#%option
-#% key: layer
-#% type: integer
-#% description: Layer to which the table to be changed is connected
-#% answer: 1
-#% required : no
-#%end
-#%option
-#% key: column
-#% type: string
-#% description: Column to update
-#% required : yes
-#%end
-#%option
-#% key: value
-#% type: string
-#% description: Value to update the column with (varchar values have to be in single quotes, e.g. 'grass'), can be (combination of) other column(s)
-#% required : no
-#%end
-#%option
-#% key: qcolumn
-#% type: string
-#% description: Column to query
-#% required : no
-#%end
-#%option
-#% key: where
-#% type: string
-#% description: WHERE conditions for update, without 'where' keyword (e.g. cat=1 or col1/col2>1)
-#% required : no
-#%end
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." >&2
- exit 1
-fi
-
-# save command line
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    CMDLINE="`basename $0`"
-    for arg in "$@" ; do
-        CMDLINE="$CMDLINE \"$arg\""
-    done
-    export CMDLINE
-    exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-#### check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message -e "awk required, please install awk or gawk first"
-    exit 1
-fi
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-### setup enviro vars ###
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-
-# does map exist in CURRENT mapset?
-eval `g.findfile element=vector file=$GIS_OPT_MAP mapset=$MAPSET`
-if [ ! "$file" ] ; then
-   g.message -e "Vector map '$GIS_OPT_MAP' not found in current mapset"
-   exit 1
-fi
-
-table=`v.db.connect map="$GIS_OPT_MAP" -g fs=";" | grep -w "$GIS_OPT_LAYER" | awk -F ";" '{print $2}'`
-if [ -z "$table" ] ; then
-   g.message -e 'There is no table connected to this map! Run v.db.connect or v.db.addtable first.'
-   exit 1
-fi
-
-database=`v.db.connect map="$GIS_OPT_MAP" -g fs=";" | grep -w "$GIS_OPT_LAYER" | awk -F ";" '{print $4}'`
-driver=`v.db.connect map="$GIS_OPT_MAP" -g fs=";" | grep -w "$GIS_OPT_LAYER" | awk -F ";" '{print $5}'`
-
-# checking column types
-coltype=`v.info -c map="$GIS_OPT_MAP" --quiet | grep -w "$GIS_OPT_COLUMN" | cut -d'|' -f1`
-
-if [ -n "$GIS_OPT_QCOLUMN" ] ; then
-   if [ -n "$GIS_OPT_VALUE" ] ; then
-      g.message -e 'Either value or qcolumn parameter have to be used'
-      exit 1
-   fi
-   # special case: we copy from another column
-   value="$GIS_OPT_QCOLUMN"
-else
-   # we insert a value
-   if [ "$coltype" = "INTEGER" -o "$coltype" = "DOUBLE PRECISION" ] ; then
-       value="$GIS_OPT_VALUE"
-   else
-       value="'$GIS_OPT_VALUE'"
-   fi
-fi
-
-if [ -n "$GIS_OPT_WHERE" ]
-  then
-    echo "UPDATE $table SET $GIS_OPT_COLUMN=$value WHERE $GIS_OPT_WHERE" |
-       db.execute database="${database}" driver=${driver}
-else
-    echo "UPDATE $table SET $GIS_OPT_COLUMN=$value" | \
-       db.execute database="${database}" driver=${driver}
-fi
-
-# write cmd history:
-v.support "${GIS_OPT_MAP}" cmdhist="${CMDLINE}"
-
-exit 0

Deleted: grass/trunk/scripts/v.dissolve/v.dissolve
===================================================================
--- grass/trunk/scripts/v.dissolve/v.dissolve	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/v.dissolve/v.dissolve	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,121 +0,0 @@
-#!/bin/sh
-############################################################################
-#
-# MODULE:       v.dissolve
-# AUTHOR:       M. Hamish Bowman, Dept. Marine Science, Otago Univeristy,
-#                 New Zealand
-#               Markus Neteler for column support
-# PURPOSE:      Dissolve common boundaries between areas with common cat
-#                 (frontend to v.extract -d)
-# COPYRIGHT:    (c) 2006 Hamish Bowman, and the GRASS Development Team
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-#############################################################################
-
-#%Module
-#% description: Dissolves boundaries between adjacent areas sharing a common category number or attribute.
-#% keywords: vector, area, dissolve
-#%End
-#%option
-#% key: input
-#% type: string
-#% gisprompt: old,vector,vector
-#% key_desc: name
-#% description: Name of input vector map 
-#% required: yes
-#%end
-#%option
-#% key: output
-#% type: string
-#% gisprompt: new,vector,vector
-#% key_desc: name
-#% description: Name for output vector map
-#% required: yes
-#%end
-#%option
-#% key: layer
-#% type: integer
-#% label: Layer number. If -1, all layers are extracted.
-#% description: A single vector map can be connected to multiple database tables. This number determines which table to use.
-#% answer: 1
-#% gisprompt: old_layer,layer,layer_all
-#% required : no
-#%end
-#%option
-#% key: column
-#% type: string
-#% description: Name of column used to dissolve common boundaries
-#% required : no
-#% gisprompt: old_dbcolumn,dbcolumn,dbcolumn
-#%end
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." 1>&2
-    exit 1
-fi
-
-# save command line
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    CMDLINE="`basename $0`"
-    for arg in "$@" ; do
-        CMDLINE="$CMDLINE \"$arg\""
-    done
-    export CMDLINE
-    exec g.parser "$0" "$@"
-fi
-
-#### setup temporary file
-TMP=$$
-
-cleanup()
-{
-   g.remove vect="$GIS_OPT_OUTPUT"_${TMP} --quiet
-}
-
-# what to do in case of user break:
-exitprocedure()
-{
-   g.message -e 'User break!'
-   cleanup
-   exit 1
-}
-# shell check for user break (signal list: trap -l)
-trap "exitprocedure" 2 3 15
-
-# does map exist?
-eval `g.findfile element=vector file=$GIS_OPT_INPUT`
-if [ ! "$file" ] ; then
-   g.message -e "Vector map '$GIS_OPT_INPUT' not found in mapset search path"
-   exit 1
-fi
-
-if [ -z "$GIS_OPT_COLUMN" ] ; then
-   v.extract -d input="$GIS_OPT_INPUT" output="$GIS_OPT_OUTPUT" type=area \
-             layer="$GIS_OPT_LAYER"
-else
-
-    COLTYPE=`v.info -c "$GIS_OPT_INPUT" --quiet | grep ".*|$GIS_OPT_COLUMN$" | cut -f1 -d'|'`
-    if [ "$COLTYPE" != "INTEGER" ] && [ "$COLTYPE" != "CHARACTER" ] ; then
-       g.message -e "Key column must be of type integer or string"
-       exit 1
-    fi
-
-   table=`v.db.connect $GIS_OPT_INPUT -g fs=";" | grep -w $GIS_OPT_LAYER | awk -F ";" '{print $2}'`
-   if [ -z "$table" ] ; then
-      g.message -e 'There is no table connected to this map!'
-      exit 1
-   fi
-   v.reclass input="$GIS_OPT_INPUT" output="$GIS_OPT_OUTPUT"_${TMP} layer="$GIS_OPT_LAYER" \
-             column="$GIS_OPT_COLUMN"
-   v.extract -d input="$GIS_OPT_OUTPUT"_${TMP} output="$GIS_OPT_OUTPUT" type=area \
-             layer="$GIS_OPT_LAYER"
-   cleanup
-fi
-
-
-# write cmd history:
-v.support ${GIS_OPT_OUTPUT} cmdhist="${CMDLINE}"
-
-exit

Deleted: grass/trunk/scripts/v.in.e00/v.in.e00
===================================================================
--- grass/trunk/scripts/v.in.e00/v.in.e00	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/v.in.e00/v.in.e00	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,245 +0,0 @@
-#!/bin/sh
-
-############################################################################
-#
-# MODULE:       v.in.e00
-#
-# AUTHOR(S):    Markus Neteler, Otto Dassau
-#
-# PURPOSE:      Import E00 data into a GRASS vector map
-#		Imports single and split E00 files (.e00, .e01, .e02 ...)
-#
-# COPYRIGHT:    (c) 2004, 2005 GDF Hannover bR, http://www.gdf-hannover.de
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-#############################################################################
-#
-# REQUIREMENTS:
-#      -  avcimport: http://avce00.maptools.org
-
-#%Module
-#%  description: Import E00 file into a vector map.
-#%  keywords: vector, import
-#%End
-#%flag
-#%  key: v
-#%  description: Verbose mode
-#%end
-#%option
-#% key: file
-#% type: string
-#% description: E00 file
-#% gisprompt: old_file,file,input
-#% required : yes
-#%end
-#%option
-#% key: type
-#% type: string
-#% options: point,line,area
-#% description: Input type point, line or area
-#% required : yes
-#%end
-#%option
-#% key: vect
-#% type: string
-#% gisprompt: new,vector,vector
-#% description: Name for output vector map
-#% required : no
-#%end
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." >&2
- exit 1
-fi   
-
-# save command line
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    CMDLINE="`basename $0`"
-    for arg in "$@" ; do
-        CMDLINE="$CMDLINE \"$arg\""
-    done
-    export CMDLINE
-    exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-#### check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message -e "awk required, please install awk or gawk first"
-    exit 1
-fi
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION="$GISDBASE"/"$LOCATION_NAME"/"$MAPSET"
-
-E00TMP=$$
-
-#### check for avcimport 
-if [ ! -x "`which avcimport`" ] ; then
-    g.message -e  "'avcimport' program not found, install it first" 
-    g.message -e "http://avce00.maptools.org" 
-    exit 1
-fi
-
-#### check for e00conv
-if [ ! -x "`which e00conv`" ] ; then
-    g.message -e "'e00conv' program not found, install it first"
-    g.message -e "http://avce00.maptools.org" 
-    exit 1
-fi
-
-#### trap ctrl-c so that we can clean up tmp
-#### take care to define ${TMP}:
-#trap 'rm -f "${TMP}"' 2 3 15
-
-# check that the user didn't use all three, which gets past the parser.
-if [ "$GIS_OPT_TYPE" != "point" ] && \
-   [ "$GIS_OPT_TYPE" != "line" ] && \
-   [ "$GIS_OPT_TYPE" != "area" ] ; then
-    g.message -e "Must specify one of \"point\", \"line\", or \"area\"." 
-    exit 1
-fi
-
-if [ -n "$GIS_OPT_FILE" ] ; then
-    E00NAME=`basename $GIS_OPT_FILE .e00`
-    # to avoid CAPs problem:
-    E00NAME=`basename $E00NAME .E00`
-    # avcimport only accepts 13 chars:
-    E00SHORTNAME="`echo $E00NAME | cut -b1-13`"
-fi
-
-#check if this is a split E00 file (.e01, .e02 ...):
-MERGING=0
-if test -f "$E00NAME.e01" ; then
-  g.message "Found that E00 file is split into pieces (.e01, ...). Merging..."
-  MERGING=1
-  EXTENSION="NOCAPS" # .e00 .e01 ...
-fi
-if test -f "$E00NAME.E01" ; then
-  g.message "Found that E00 file is split into pieces (.e01, ...). Merging..."
-  MERGING=1
-  EXTENSION="CAPS" # .E00 .E01 ...
-fi
-
-
-if [ -z "$GIS_OPT_TYPE" ] ; then
-    g.message -e "Input type is missing - choose point, line or area"
-    exit 1
-fi
-
-if [ -n "$GIS_OPT_VECT" ] ; then
-    NAME="$GIS_OPT_VECT"
-else
-    NAME="$E00NAME"
-fi
-
-### do import
-
-#make a temporary directory
-TMPDIR="`g.tempfile pid=$$`"
-if [ $? -ne 0 ] || [ -z "$TMPDIR" ] ; then
-    g.message "Unable to create temporary files" 
-    exit 1
-fi
-
-rm -f "$TMPDIR"
-mkdir "$TMPDIR"
-
-install -m 644 $E00NAME.e* $E00NAME.E* "$TMPDIR" 2>/dev/null
-
-#change to temporary directory to later avoid removal problems (rm -r ...)
-cd "$TMPDIR"
-
-#check for binay E00 file (we can just check if import fails):
-#avcimport doesn't set exist status :-(
-
-if [ $MERGING -eq 1 ] ; then
-  if  [ "$EXTENSION" = "CAPS" ] ; then
-     cat `ls -1 "$E00NAME.E"* | sort` > "$E00NAME.cat.$E00TMP.e00"
-     GIS_OPT_FILE="$E00NAME.cat.$E00TMP.e00"
-  fi
-  if  [ "$EXTENSION" = "NOCAPS" ] ; then
-     cat `ls -1 "$E00NAME.e"* | sort` > "$E00NAME.cat.$E00TMP.e00"
-     GIS_OPT_FILE="$E00NAME.cat.$E00TMP.e00"
-  fi
-fi
-
-g.message "An error may appear next which will be ignored..."
-avcimport "$GIS_OPT_FILE" "$E00SHORTNAME" 2>/dev/null >/dev/null
-if [ $? -eq 1 ] ; then
-   g.message "E00 ASCII found and converted to Arc Coverage in current directory"
-else
-   g.message "E00 Compressed ASCII found. Will uncompress first..."
-   rm -rf "$E00SHORTNAME" info
-   e00conv "$GIS_OPT_FILE" "$E00TMP.e00"
-   g.message "...converted to Arc Coverage in current directory"
-   avcimport "$E00TMP.e00" "$E00SHORTNAME" 2>/dev/null
-fi
-
-## let's import...
-## point
-
-#SQL name fix:
-NAME=`echo $NAME | sed 's+-+_+g'`
-
-if [ "$GIS_OPT_TYPE" = "point" ] ; then
-        g.message "Importing points..."
-        v.in.ogr -o dsn="$E00SHORTNAME" layer=LAB type=point output="$NAME"
-	if [ $? -eq 1 ] ; then
-   	g.message -e "An error occurred while running v.in.ogr"
-   	rm -rf "$E00TMP.e00" "$E00SHORTNAME" info 2>&1 > /dev/null
-   	exit 1
-	fi
-fi
-
-## line
-
-if [ "$GIS_OPT_TYPE" = "line" ] ; then
-        g.message "Importing lines..."
-        v.in.ogr -o dsn="$E00SHORTNAME" layer=ARC type=line output="$NAME"
-	if [ $? -eq 1 ] ; then
-   	g.message -e "An error occurred while running v.in.ogr"
-   	rm -rf "$E00TMP.e00" "$E00SHORTNAME" info 2>&1 > /dev/null
-   	exit 1
-	fi
-fi
-
-## area
-
-
-if [ "$GIS_OPT_TYPE" = "area" ] ; then
-        g.message "Importing areas..."
-        # we must reconstruct topology and cleanup polygons:
-        v.in.ogr -o dsn="$E00SHORTNAME" layer=LAB,ARC type=centroid,boundary output="$NAME"
-	if [ $? -eq 1 ] ; then
-   	g.message -e "An error occurred. Stop."
-   	rm -rf "$E00TMP.e00" "$E00SHORTNAME" info 2>&1 > /dev/null
-   	exit 1
-	fi
-fi
-
-g.message "Imported <$GIS_OPT_TYPE> vector map <$NAME>."
-
-#### clean up the mess
-rm -f "${TMPDIR}/$E00NAME.e"* "${TMPDIR}/$E00NAME.E"*
-rm -rf "$E00TMP.e00" "$E00SHORTNAME" info "$E00NAME.cat.$E00TMP.e00" 2>&1 > /dev/null
-cd ..
-rmdir "$TMPDIR"
-
-#### end
-g.message "Done."
-
-# write cmd history:
-v.support "$NAME" cmdhist="${CMDLINE}"
-
-exit 0

Deleted: grass/trunk/scripts/v.in.geonames/v.in.geonames
===================================================================
--- grass/trunk/scripts/v.in.geonames/v.in.geonames	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/v.in.geonames/v.in.geonames	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,168 +0,0 @@
-#!/bin/sh
-
-############################################################################
-#
-# MODULE:       v.in.geonames
-#
-# AUTHOR(S):    Markus Neteler, neteler cealp it
-#
-# PURPOSE:      Import geonames.org dumps
-#               http://download.geonames.org/export/dump/
-#
-#               Feature Codes: http://www.geonames.org/export/codes.html
-#
-# COPYRIGHT:    (c) 2008 Markus Neteler, GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-# TODO: fix encoding issues for Asian fonts in 'alternatename' column (v.in.ascii)
-#       fix spurious char stuff in elevation column
-#############################################################################
-
-#%Module
-#%  description: Imports geonames.org country files into a GRASS vector points map.
-#%  keywords: vector, import, gazetteer
-#%End
-#%option
-#% key: input
-#% type: string
-#% key_desc: name
-#% description: Uncompressed geonames file from (with .txt extension)
-#% gisprompt: old_file,file,input
-#% required : yes
-#%end
-#%option
-#% key: output
-#% type: string
-#% key_desc: name
-#% gisprompt: new,vector,vector
-#% description: Name for output vector map
-#% required : yes
-#%end
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." >&2
-    exit 1
-fi
-
-# save command line
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    CMDLINE="`basename $0`"
-    for arg in "$@" ; do
-        CMDLINE="$CMDLINE \"$arg\""
-    done
-    export CMDLINE
-    exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-#### check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message -e "awk required, please install awk/gawk first"
-    exit 1
-fi
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION="$GISDBASE"/"$LOCATION_NAME"/"$MAPSET"
-
-
-if [ -n "$GIS_OPT_INPUT" ] ; then
-    FILEORIG="$GIS_OPT_INPUT"
-    if [ -n "$GIS_OPT_VECT" ] ; then
-       FILE="$GIS_OPT_VECT"
-    else
-       FILE=`basename $FILEORIG .txt`
-       FILE=`basename $FILE .csv`
-    fi
-fi
-
-#### setup temporary file
-TMPFILE="`g.tempfile pid=$$`"
-if [ $? -ne 0 ] || [ -z "$TMPFILE" ] ; then
-    g.message -e "Unable to create temporary files"
-    exit 1
-fi
-#### trap ctrl-c so that we can clean up tmp
-trap 'rm -f "${TMPFILE}" "${TMPFILE}_ascii.csv"' 2 3 15
-
-#are we in LatLong location?
-g.proj -p | grep -i name | grep -i Lon  > /dev/null
-if [ $? -eq 1 ] ; then
-  g.message -e "This module only operates in LatLong/WGS84 locations"
-  exit 1
-fi
-
-# input test
-if [ ! -f "$GIS_OPT_INPUT" ] ; then
-    g.message -e "File '${FILEORIG}' not found"
-    exit 1
-fi
-
-# DBF doesn't support lengthy text fields
-driver=`db.connect -p | grep -i driver | cut -d':' -f2`
-if [ "$driver" = "dbf" ] ; then
-   g.message -w "Since DBF driver is used, the content of the 'alternatenames' column might be cut with respect to the original Geonames.org column content"
-fi
-
-
-#let's go
-#change TAB to semicolon (we cannot use 'tr' due to possibly repeated empty columns)
-TAB=`awk 'BEGIN{printf "\t";}'`
-cat "${FILEORIG}" | sed  "s+$TAB+|+g"  > "${TMPFILE}".csv
-
-NUM_PLACES=`wc -l "${TMPFILE}.csv" | awk '{print $1}'`
-g.message "Converted $NUM_PLACES place names."
-
-# pump data into GRASS:
-#  http://download.geonames.org/export/dump/readme.txt
-#  The main 'geoname' table has the following fields :
-#  ---------------------------------------------------
-#  geonameid         : integer id of record in geonames database
-#  name              : name of geographical point (utf8) varchar(200)
-#  asciiname         : name of geographical point in plain ascii characters, varchar(200)
-#  alternatenames    : alternatenames, comma separated varchar(4000)
-#  latitude          : latitude in decimal degrees (wgs84)
-#  longitude         : longitude in decimal degrees (wgs84)
-#  feature class     : see http://www.geonames.org/export/codes.html, char(1)
-#  feature code      : see http://www.geonames.org/export/codes.html, varchar(10)
-#  country code      : ISO-3166 2-letter country code, 2 characters
-#  cc2               : alternate country codes, comma separated, ISO-3166 2-letter country code, 60 characters
-#  admin1 code       : fipscode (subject to change to iso code), isocode for the us and ch, see file admin1Codes.txt for display names of this code; varchar(20)
-#  admin2 code       : code for the second administrative division, a county in the US, see file admin2Codes.txt; varchar(80)
-#  admin3 code       : code for third level administrative division, varchar(20)
-#  admin4 code       : code for fourth level administrative division, varchar(20)
-#  population        : integer
-#  elevation         : in meters, integer
-#  gtopo30           : average elevation of 30'x30' (ca 900mx900m) area in meters, integer
-#  timezone          : the timezone id (see file http://download.geonames.org/export/dump/timeZones.txt)
-#  modification date : date of last modification in yyyy-MM-dd format
-
-# geonameid|name|asciiname|alternatenames|latitude|longitude|featureclass|featurecode|countrycode|cc2|admin1code|admin2code|admin3code|admin4code|population|elevation|gtopo30|timezone|modificationdate
-
-# TODO: elevation seems to contain spurious char stuff :(
-
-# debug:
-# head -n 3 ${TMPFILE}.csv
-v.in.ascii cat=0 x=6 y=5 fs="|" in="${TMPFILE}.csv" out="$GIS_OPT_OUTPUT" \
-   columns='geonameid integer, name varchar(200), asciiname varchar(200), alternatename varchar(4000), latitude double precision, longitude double precision, featureclass varchar(1), featurecode varchar(10), countrycode varchar(2), cc2 varchar(60), admin1code varchar(20), admin2code varchar(20), admin3code varchar(20), admin4code varchar(20), population integer, elevation varchar(5), gtopo30 integer, timezone varchar(50), modification date'
-
-if [ $? -eq 0 ] ; then
-   # write cmd history:
-   v.support $GIS_OPT_OUTPUT cmdhist="${CMDLINE}"
-   rm -f "${TMPFILE}.csv"
-   exit 0
-fi
-rm -f "${TMPFILE}.csv"
-
-# should not happen
-exit 1
-

Deleted: grass/trunk/scripts/v.in.gns/v.in.gns
===================================================================
--- grass/trunk/scripts/v.in.gns/v.in.gns	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/v.in.gns/v.in.gns	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,139 +0,0 @@
-#!/bin/sh
-
-############################################################################
-#
-# MODULE:       v.in.gns
-#
-# AUTHOR(S):    Markus Neteler, neteler itc it
-#
-# PURPOSE:      Import GEOnet Names Server (GNS) country files into a GRASS vector map
-#               http://earth-info.nga.mil/gns/html/
-#                -> Download Names Files for Countries and Territories (FTP)
-#
-#               Column names: http://earth-info.nga.mil/gns/html/help.htm
-#
-# COPYRIGHT:    (c) 2005 GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-# TODO:         - see below in the code
-#               - add extra columns explaining some column acronyms, 
-#                 e.g. FC (Feature Classification)
-#############################################################################
-
-#%Module
-#%  description: Imports US-NGA GEOnet Names Server (GNS) country files into a GRASS vector points map.
-#%  keywords: vector, import, gazetteer
-#%End
-#%option
-#% key: file
-#% type: string
-#% description: Uncompressed GNS file from NGA (with .txt extension)
-#% gisprompt: old_file,file,input
-#% required : yes
-#%end
-#%option
-#% key: vect
-#% type: string
-#% gisprompt: new,vector,vector
-#% description: Name for output vector map
-#% required : no
-#%end
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." >&2
-    exit 1
-fi
-
-# save command line
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    CMDLINE="`basename $0`"
-    for arg in "$@" ; do
-        CMDLINE="$CMDLINE \"$arg\""
-    done
-    export CMDLINE
-    exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-#### check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message -e "awk required, please install awk/gawk first"
-    exit 1
-fi
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION="$GISDBASE"/"$LOCATION_NAME"/"$MAPSET"
-
-
-if [ -n "$GIS_OPT_FILE" ] ; then
-    FILEORIG="$GIS_OPT_FILE"
-    if [ -n "$GIS_OPT_VECT" ] ; then
-       FILE="$GIS_OPT_VECT"
-    else
-       FILE=`basename $FILEORIG .txt`
-    fi
-fi
-
-#### setup temporary file
-TMPFILE="`g.tempfile pid=$$`"
-if [ $? -ne 0 ] || [ -z "$TMPFILE" ] ; then
-    g.message -e "Unable to create temporary files"
-    exit 1
-fi
-#### trap ctrl-c so that we can clean up tmp
-trap 'rm -f "${TMPFILE}" "${TMPFILE}_ascii.csv"' 2 3 15
-
-#are we in LatLong location?
-g.proj -p | grep -i name | grep -i Lon  > /dev/null
-if [ $? -eq 1 ] ; then
-  g.message -e "This module only operates in LatLong/WGS84 locations"
-  exit 1
-fi
-
-#let's go
-#change TAB to semicolon
-TAB=`awk 'BEGIN{printf "\t";}'`
-cat "${FILEORIG}" | sed  "s+$TAB+;+g"  > "${TMPFILE}"
-
-#header elimination:
-HEADER="RC;UFI;UNI;LAT;LONG;DMS_LAT;DMS_LONG;UTM;JOG;FC;DSG;PC;CC1;ADM1;ADM2;DIM;CC2;NT;LC;SHORT_FORM;GENERIC;SORT_NAME;FULL_NAME;FULL_NAME_ND;MODIFY_DATE"
-cat "${TMPFILE}" | grep -v "^${HEADER}" > "${TMPFILE}_ascii.csv"
-rm -f "${TMPFILE}"
-
-NUM_PLACES=`wc -l "${TMPFILE}_ascii.csv" | awk '{print $1}'`
-g.message "Converted $NUM_PLACES place names."
-
-#TODO: fix dms_lat,dms_long DDMMSS -> DD:MM:SS
-# Solution:
-# IN=DDMMSS
-# DEG=`echo $IN | cut -b1,2`
-# MIN=`echo $IN | cut -b3,4`
-# SEC=`echo $IN | cut -b5,6`
-# DEG_STR="$DEG:$MIN:$SEC"
-
-#modifications (to match DBF 10 char column name limit):
-# short_form   -> shortform
-# sort_name    -> sortname
-# full_name    -> fullname
-# full_name_sd -> funamesd
-#
-# pump data into GRASS:
-v.in.ascii cat=0 x=5 y=4 fs=';' in="${TMPFILE}_ascii.csv" out="$FILE" \
-   columns='rc integer,uf1 integer,uni integer,lat double precision,lon double precision,dms_lat varchar(6),dms_long varchar(7),utm varchar(4),jog varchar(7),fc varchar(1),dsg varchar(5),pc integer,cci varchar(2),adm1 varchar(2),adm2 varchar(200),dim integer,cc2 varchar(2),nt varchar(1),lc varchar(3),shortform varchar(128),generic varchar(128),sortname varchar(200),fullname varchar(200),funamesd varchar(200),mod_date date' 
-
-rm -f "${TMPFILE}_ascii.csv"
-
-# write cmd history:
-v.support "$FILE" cmdhist="${CMDLINE}"
-
-exit 0

Deleted: grass/trunk/scripts/v.in.mapgen/v.in.mapgen
===================================================================
--- grass/trunk/scripts/v.in.mapgen/v.in.mapgen	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/v.in.mapgen/v.in.mapgen	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,185 +0,0 @@
-#!/bin/sh
-#
-############################################################################
-#
-# MODULE:       v.in.mapgen
-#
-# AUTHOR(S):    Andreas Lange, andreas.lange at rhein-main.de
-#               Updated for GRASS 6 by Hamish Bowman
-#
-# PURPOSE:      Import data from Mapgen or Matlab into a GRASS vector map
-#
-# COPYRIGHT:    Original version (c) Andreas Lange
-#               Updates by Hamish Bowman (c) the GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#############################################################################
-#
-# REQUIREMENTS:  awk
-#
-# DATA AVAILABILITY: e.g., NOAA's Online Coastline Extractor
-#                    http://www.ngdc.noaa.gov/mgg/shorelines/shorelines.html
-#
-
-#%Module
-#%  description: Import Mapgen or Matlab vector maps into GRASS.
-#%  keywords: vector, import
-#%End
-#%flag
-#%  key: f
-#%  description: Input map is in Matlab format
-#%end
-#%flag
-#%  key: z
-#%  description: Create a 3D vector points map from 3 column Matlab data 
-#%end
-#%option
-#% key: input
-#% type: string
-#% gisprompt: old_file,file,input
-#% description: Name of input file in Mapgen/Matlab format
-#% required : yes
-#%end
-#%option
-#% key: output
-#% type: string
-#% gisprompt: new,vector,vector
-#% description: Name for output vector map (omit for display to stdout)
-#% required : no
-#%end
-
-if [ -z "$GISBASE" ] ; then
-   echo "You must be in GRASS GIS to run this program." >&2
-   exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-  exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-#### check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message -e "awk required, please install awk or gawk first" 
-    exit 1
-fi
-
-# set environment so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION=$GISDBASE/$LOCATION_NAME/$MAPSET
-
-OPTS=""
-
-FILE="$GIS_OPT_INPUT"
-if [ ! -e "$FILE" ] ; then
-   g.message -e "Input file <$FILE> not found."
-   exit 1
-fi
-
-if [ -n "$GIS_OPT_OUTPUT" ] ; then
-    NAME="$GIS_OPT_OUTPUT"
-else
-    unset NAME
-fi
-
-
-# -z implies -f
-if [ $GIS_FLAG_Z -eq 1 ] && [ $GIS_FLAG_F -eq 0 ] ; then
-   GIS_FLAG_F=1
-fi
-
-if [ $GIS_FLAG_Z -eq 1 ] ; then
-  # make a 3D vector file
-  do3D="-z"
-else
-  do3D=""
-fi
-
-#### setup temporary file
-TMP="`g.tempfile pid=$$`"
-if [ $? -ne 0 ] || [ -z "$TMP" ] ; then
-    g.message -e "unable to create temporary files"
-    exit 1
-fi
-
-#### trap ctrl-c so that we can clean up tmp
-trap 'rm -f "$TMP"' 2 3 15
-
-#### create ascii vector file
-if [ $GIS_FLAG_F -eq 1 ] ; then
-  ## HB:  OLD v.in.mapgen.sh Matlab import command follows.
-  ##    I have no idea what it's all about, so "new" matlab format will be
-  ##    a series of x y with "nan nan" breaking lines. (as NOAA provides)
-  ##  Old command:
-  #  tac $FILE | $AWK 'BEGIN { FS="," ; R=0 }
-  #    $1~/\d*/   { printf("L %d\n", R) }
-  #    $1~/   .*/ { printf(" %lf %lf\n", $2, $1) ; ++R }
-  #    $1~/END/   { }' | tac > "$TMP"
-
-  ## matlab format. Cleanse with NaN->nan and spaces to tabs
-  tac "$FILE" | awk '{print $1 "\t" $2 "\t" $3}
-    END {if ($3~/[0-9Nna]/) print "NaN\tNaN\tNaN"
-         else print "NaN\tNaN"}' | \
-   tr 'N' 'n' | awk '
-    BEGIN { FS="\t" ; R=0 }
-    $1~/nan.*/ { printf("L %d\n", R) ; R=0 }
-    $1~/\d*\.\d*/ { printf(" %.8f %.8f %.8f\n", $1, $2, $3) ; ++R }
-    END {;}' | \
-   grep -v "^L 0$" | tac > "$TMP"
-
-else
-  ## mapgen format.
-  tac "$FILE" | awk '
-    BEGIN { FS="\t" ; R=0 }
-    $1~/#.*/ { printf("L %d\n", R) ; R=0 }
-    $1~/\d*\.\d*/ { printf(" %.8f %.8f\n", $1, $2) ; ++R }
-    END {;}' | tac > "$TMP"
-fi
-
-#### create digit header
-cat << EOF > "${TMP}.dig"
-ORGANIZATION: GRASSroots organization
-DIGIT DATE:   `date +%D`
-DIGIT NAME:   $PROG
-MAP NAME:     $NAME
-MAP DATE:     `date +%Y`
-MAP SCALE:    1
-OTHER INFO:   Imported by `echo $USER@$HOSTNAME`
-ZONE:         0
-MAP THRESH:   0
-VERTI:
-EOF
-
-#### process points list to ascii vector file (merge in vertices)
-cat "${TMP}" >> "${TMP}.dig"
-
-#### if no name for vector file given, cat to stdout
-if [ "$NAME" = "" ] ; then
-    g.message "Output to stdout" 
-    cat "${TMP}.dig" 2>/dev/null
-else
-    #### import to binary vector file
-    g.message "Importing with v.in.ascii ..." 
-    v.in.ascii $do3D input="${TMP}.dig" output="$NAME" format=standard
-
-    #### check success/failure
-    if [ $? -eq 0 ] ; then
-	g.message message="\"$NAME@$MAPSET\" successfully created." 
-    else
-	g.message -e "An error occured on creating \"$NAME\" in mapset \"$MAPSET\", please check"'!'
-    fi
-fi
-
-#### clean up the mess
-rm -f "$TMP" "${TMP}.dig"
-
-#### end
-exit 0

Deleted: grass/trunk/scripts/v.in.sites.all/v.in.sites.all
===================================================================
--- grass/trunk/scripts/v.in.sites.all/v.in.sites.all	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/v.in.sites.all/v.in.sites.all	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,65 +0,0 @@
-#!/bin/sh
-############################################################################
-#
-# MODULE:	v.in.sites.all
-# AUTHOR(S):	Markus Neteler
-# PURPOSE:	converts all old GRASS < V5.7 sites maps to vector maps
-#		in current mapset
-# COPYRIGHT:	(C) 2004 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-#############################################################################
-
-#%Module
-#% description: Converts all old GRASS < Ver5.7 sites maps in current mapset to vector maps.
-#% keywords: sites, vector, import
-#%End
-#%flag
-#% key: r
-#% description: Run non-interactively
-#%end
-
-if test "$GISBASE" = ""; then
-    echo "You must be in GRASS GIS to run this program." >&2
-    exit 1
-fi
-
-# the -r flag is a noop, just there to stop the gui coming up.
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    exec g.parser "$0" "$@"
-fi
-
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION=$GISDBASE/$LOCATION_NAME/$MAPSET
-
-CONVERTEDMAPS=0
-for i in `g.mlist type=sites`
-do
-
-  # polish map names to be SQL compliant
-  INPUT=$i
-  OUTPUT=`echo $INPUT | sed 's+\.+_+g'`_points
-
-  #do it:
-  g.message "Processing $INPUT -> $OUTPUT" 
-  v.in.sites in=$INPUT out=$OUTPUT
-  if [ $? -ne 0 ] ; then
-    g.message -w "Error converting map $INPUT to $OUTPUT" 
-  else
-    CONVERTEDMAPS=`expr $CONVERTEDMAPS + 1`
-  fi
-done
-
-if [ $CONVERTEDMAPS -lt 1 ] ; then
-  g.message -e "No sites maps converted as no old sites maps present in current mapset <$MAPSET>." 
-else
-  g.message "Total $CONVERTEDMAPS number of sites maps in current mapset converted to vector" 
-  g.message "maps (original names extended by '_points'). Please verify new vector map(s)" 
-  g.message "before deleting old sites map(s)." 
-fi
-
-exit 0

Deleted: grass/trunk/scripts/v.in.wfs/v.in.wfs
===================================================================
--- grass/trunk/scripts/v.in.wfs/v.in.wfs	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/v.in.wfs/v.in.wfs	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,73 +0,0 @@
-#!/bin/sh
-
-############################################################################
-#
-# MODULE:	v.in.wfs
-# AUTHOR(S):	Markus Neteler. neteler itc it
-#               Hamish Bowman (fixes)
-# PURPOSE:	WFS support
-# COPYRIGHT:	(C) 2006, 2007 Markus Neteler and GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-# GetFeature example:
-# http://mapserver.gdf-hannover.de/cgi-bin/grassuserwfs?REQUEST=GetFeature&SERVICE=WFS&VERSION=1.0.0
-#############################################################################
-
-#%Module
-#% description: import GetFeature from WFS
-#%End
-#%option
-#% key: wfs
-#% type: string
-#% description: GetFeature URL starting with http
-#%End
-#%option
-#% key: output
-#% type: string
-#% gisprompt: new,vector,vector
-#% description: Vector output map
-#% required : yes
-#%End
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." 1>&2
-    exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    exec g.parser "$0" "$@"
-fi
-
-# xerces support compiled in?
-OGRINFO=`which ogrinfo`
-if [ -z "`ldd $OGRINFO | grep xerces`" ] ; then
-  g.message -e "OGR needs to be compiled with xerces-c support"
-  exit 1
-fi
-
-#### check if we have lynx
-if [ ! -x "`which lynx`" ] ; then
-    g.message -e "'lynx' is required, please install first"
-    exit 1
-fi
-
-TMP="`g.tempfile pid=$$`"
-if [ $? -ne 0 ] || [ -z "$TMP" ] ; then
-    g.message -e "Unable to create temporary files"
-    exit 1
-fi
-
-OUT=$GIS_OPT_output
-WFS_URL="$GIS_OPT_WFS"
-
-g.message "Retrieving data ..."
-lynx -source "$WFS_URL" > "$TMP.xml"
-
-v.in.ogr dsn="$TMP.xml" out=$OUT -o
-#rm -f "$TMP.xml"
-
-g.message "Vector points map <$OUT> imported from WFS."
-exit 0

Deleted: grass/trunk/scripts/v.rast.stats/v.rast.stats
===================================================================
--- grass/trunk/scripts/v.rast.stats/v.rast.stats	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/v.rast.stats/v.rast.stats	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,335 +0,0 @@
-#!/bin/sh
-
-############################################################################
-#
-# MODULE:	v.rast.stats
-# AUTHOR(S):	Markus Neteler
-# PURPOSE:	Calculates univariate statistics from a GRASS raster map
-#		only for areas covered by vector objects on a per-category base
-# COPYRIGHT:	(C) 2005 by the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-# TODO: do we need layer= management?
-#############################################################################
-
-#%Module
-#%  description: Calculates univariate statistics from a GRASS raster map based on vector polygons and uploads statistics to new attribute columns.
-#%  keywords: vector, raster, statistics
-#%End
-#%flag
-#%  key: c
-#%  description: Continue if upload column(s) already exist
-#%END
-#%flag
-#%  key: e
-#%  description: Calculate extended statistics
-#%END
-#%option
-#% key: vector
-#% type: string
-#% key_desc: name
-#% gisprompt: old,vector,vector
-#% description: Name of vector polygon map
-#% required : yes
-#%End
-#%option
-#% key: layer
-#% type: integer
-#% description: Layer to which the table to be changed is connected
-#% answer: 1
-#% required : no
-#%end
-#%option
-#% key: raster
-#% type: string
-#% key_desc: name
-#% gisprompt: old,cell,raster
-#% description: Name of raster map to calculate statistics from
-#% required : yes
-#%END
-#%option
-#% key: colprefix
-#% type: string
-#% description: Column prefix for new attribute columns
-#% required : yes
-#%end
-#%option
-#% key: percentile
-#% type: integer
-#% description: Percentile to calculate (requires extended statistics flag)
-#% options: 0-100
-#% answer: 90
-#% required : no
-#%end
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." >&2
-    exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    exec g.parser "$0" "$@"
-fi
-
-PROG=`basename $0`
-
-#### check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    g.message "awk required, please install awk or gawk first" 
-    exit 1
-fi
-
-# setting environment, so that awk works properly in all languages
-unset LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-#### setup temporary file
-TMP="`g.tempfile pid=$$`"
-if [ $? -ne 0 ] || [ -z "$TMP" ] ; then
-    g.message -e "Unable to create temporary files" 
-    exit 1
-fi
-SQLTMP="$TMP.sql"
-# we need a random name
-TMPNAME=`basename "$TMP"`
-
-cleanup()
-{
-   #restore settings:
-   g.region region="$TMPNAME"
-   g.remove region="$TMPNAME" --quiet
-   g.remove rast="${VECTOR}_${TMPNAME}" --quiet
-   g.remove MASK --quiet 2>/dev/null
-   if [ $MASKFOUND -eq 1 ] ; then
-      g.message "Restoring previous MASK..."
-      g.rename "${TMPNAME}_origmask",MASK --quiet
-   fi
-   rm -f "$TMP" "$TMPNAME" "$TMP.cats" "$SQLTMP"
-}
-
-# what to do in case of user break:
-exitprocedure()
-{
-   g.message -e 'User break!'
-   cleanup
-   exit 1
-}
-# shell check for user break (signal list: trap -l)
-trap "exitprocedure" 2 3 15
-
-
-RASTER="$GIS_OPT_RASTER"
-COLPREFIX="$GIS_OPT_COLPREFIX"
-
-### setup enviro vars ###
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-
-# does map exist in CURRENT mapset?
-eval `g.findfile element=vector file="$GIS_OPT_VECTOR" mapset="$MAPSET"`
-VECT_MAPSET=`echo "$GIS_OPT_VECTOR" | grep '@' | cut -f2 -d'@'`
-if [ -z "$VECT_MAPSET" ] ; then
-   VECT_MAPSET="$MAPSET"
-fi
-if [ ! "$file" ] || [ "$VECT_MAPSET" != "$MAPSET" ] ; then
-   g.message -e "Vector map <$GIS_OPT_VECTOR> not found in current mapset"
-   exit 1
-else
-   VECTOR=`echo "$GIS_OPT_VECTOR" | cut -f1 -d'@'`
-fi
-
-#check the input raster map
-eval `g.findfile element=cell file="$RASTER"`
-if [ ! "$file" ] ; then
-   g.message -e "Raster map <$RASTER> not found"
-   exit 1
-fi
-
-#check presence of raster MASK, put it aside
-MASKFOUND=0
-eval `g.findfile element=cell file=MASK`
-if [ "$file" ] ; then
-   g.message "Raster MASK found, temporarily disabled"
-   g.rename MASK,"${TMPNAME}_origmask" --quiet
-   MASKFOUND=1
-fi
-
-#get RASTER resolution of map which we want to query:
-#fetch separated to permit for non-square cells (latlong etc)
-NSRES=`r.info -s "$RASTER" | grep nsres | cut -d'=' -f2`
-if [ $? -ne 0 ] ; then
-   g.message -e "An error occurred reading the input raster map resolution."
-   cleanup
-   exit 1
-fi
-EWRES=`r.info -s "$RASTER" | grep ewres | cut -d'=' -f2`
-
-#save current settings:
-g.region save="$TMPNAME" --quiet
-
-#Temporarily setting raster resolution to $RASTER resolution
-#keep boundary settings
-g.region nsres=$NSRES ewres=$EWRES -a
-
-#prepare raster MASK
-v.to.rast in="$VECTOR" out="${VECTOR}_${TMPNAME}" use=cat --quiet
-if [ $? -ne 0 ] ; then
-   g.message -e "An error occurred while converting vector to raster"
-   cleanup
-   exit 1
-fi
-
-
-#dump cats to file to avoid "too many argument" problem:
-r.category "${VECTOR}_${TMPNAME}" fs=';' --quiet | cut -d';' -f1 > "$TMP.cats"
-#echo "List of categories found: $CATSLIST"
-NUMBER=`cat "$TMP.cats" | wc -l | awk '{print $1}'`
-if [ $NUMBER -lt 1 ] ; then
-   g.message -e "No categories found in raster map"
-   cleanup
-   exit 1
-fi
-
-
-#check if DBF driver used, in this case cut to 10 chars col names:
-DBFDRIVER=0
-v.db.connect -g "$VECTOR" fs=";" | grep -w "$GIS_OPT_LAYER" | cut -d';' -f5 | grep -i dbf --quiet
-if [ $? -eq 0 ] ; then
-   DBFDRIVER=1
-else
-   # in case a table is missing, we'll trap a crash later...
-   DBFDRIVER=0
-fi
-# we need this for non-DBF driver:
-DB_SQLDRIVER=`v.db.connect -g "$VECTOR" fs=";" | cut -d';' -f5`
-DB_DATABASE="`v.db.connect -g "$VECTOR" fs=";" | cut -d';' -f4`"
-
-#Find out which table is linked to the vector map on the given layer
-TABLE=`v.db.connect map="$VECTOR" -g fs=";" | grep -w "$GIS_OPT_LAYER" | awk -F ";" '{print $2}'`
-if [ -z "$TABLE" ] ; then
-   g.message -e 'There is no table connected to this map! Run v.db.connect or v.db.addtable first.'
-   exit 1
-fi
-
-
-BASECOLS="n min max range mean stddev variance cf_var sum"
-
-# do extended stats?
-if [ $GIS_FLAG_E -eq 1 ] ; then
-   # namespace is limited in DBF but the % value is important
-   if [ $DBFDRIVER -eq 1 ] ; then
-      PERCCOL="per$GIS_OPT_PERCENTILE"
-   else
-      PERCCOL="percentile_$GIS_OPT_PERCENTILE"
-   fi
-   EXTRACOLS="first_quartile median third_quartile $PERCCOL"
-else
-   EXTRACOLS=""
-fi
-
-
-unset ADDCOLS
-for i in $BASECOLS $EXTRACOLS ; do
-  #check if column already present
-  if [ $DBFDRIVER -eq 1 ] ; then
-     CURRCOLUMN="`echo "${COLPREFIX}_${i}" | cut -b1-10`"
-  else
-     CURRCOLUMN="${COLPREFIX}_${i}"
-  fi
-  v.info -c $VECTOR --quiet | sed 's+^+|+g' | sed 's+$+|+g' | \
-    grep "|$CURRCOLUMN|" --quiet
-  if [ $? -eq 0 ] ; then
-    if [ $GIS_FLAG_C -ne 1 ] ; then
-       g.message -e "Cannot create column <$CURRCOLUMN> (already present). \
-         Use -c flag to update values in this column."
-       cleanup
-       exit 1
-    fi
-  else
-    if [ -n "$ADDCOLS" ] ; then
-       ADDCOLS="$ADDCOLS,"
-    fi
-    if [ "$i" = "n" ] ; then
-       COLTYPE="INTEGER"
-    else
-       COLTYPE="DOUBLE PRECISION"
-    fi
-    ADDCOLS="$ADDCOLS $CURRCOLUMN $COLTYPE"
-  fi
-done
-
-g.message -v "Adding columns <$ADDCOLS>"
-v.db.addcol map="$VECTOR" columns="$ADDCOLS"
-if [ $? -ne 0 ] ; then
-   g.message -e "Cannot continue (problem adding columns)."
-   cleanup
-   exit 1
-fi
-
-
-#loop over cats and calculate statistics:
-g.message -v "Processing data ..."
-CURRNUM=1
-# get rid of any earlier attempts
-rm -f "$SQLTMP"
-
-# do extended stats?
-if [ $GIS_FLAG_E -eq 1 ] ; then
-   EXTSTAT="-e"
-else
-   EXTSTAT=""
-fi
-
-for i in `cat "$TMP.cats"` ; do
-   g.message -v message="Processing category $i ($CURRNUM/$NUMBER)"
-   g.remove MASK --quiet 2>/dev/null
-   # r.mapcalc doesn't use the parser, so we set the env var version instead
-   GRASS_VERBOSE=0 \
-     r.mapcalc "MASK=if(${VECTOR}_${TMPNAME} == $i, 1, null())"
-
-   #n, min, max, range, mean, stddev, variance, coeff_var, sum
-   unset $BASECOLS $EXTRACOLS
-   eval `r.univar -g $EXTSTAT map="$RASTER" percentile="$GIS_OPT_PERCENTILE" | sed 's+nan+NULL+g'`
-   # How to test r.univar $? exit status? using -e creates the real possibility of out-of-memory errors
-
-   cf_var="$coeff_var"
-   if [ $GIS_FLAG_E -eq 1 ] && [ $DBFDRIVER -eq 1 ] ; then
-      eval "$PERCCOL=\$percentile_$GIS_OPT_PERCENTILE"
-   fi
-
-   for var in $BASECOLS $EXTRACOLS ; do
-      eval value=\${$var}
-
-      if [ $DBFDRIVER -eq 1 ] ; then
-	colname="`echo "${COLPREFIX}_${var}" | cut -b1-10`"
-      else
-	colname="${COLPREFIX}_${var}"
-      fi
-
-      echo "UPDATE $TABLE SET ${colname}=${value} WHERE cat=$i;" >> "$SQLTMP"
-   done
-
-   CURRNUM=`expr $CURRNUM + 1`
-done
-
-
-g.message -v "Updating the database ..."
-db.execute input="$SQLTMP" database="${DB_DATABASE}" driver="$DB_SQLDRIVER"
-EXITCODE=$?
-
-
-g.remove MASK --quiet 2>/dev/null
-
-cleanup
-
-if [ "$EXITCODE" -eq 0 ] ; then
-  g.message "Statistics calculated from raster map <$RASTER> and uploaded to \
-    attribute table of vector map <$VECTOR>."
-  g.message "Done."
-fi
-
-exit $EXITCODE

Deleted: grass/trunk/scripts/v.report/v.report
===================================================================
--- grass/trunk/scripts/v.report/v.report	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/v.report/v.report	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,211 +0,0 @@
-#!/bin/sh
-#
-############################################################################
-#
-# MODULE:	v.report
-# AUTHOR(S):	Markus Neteler
-# PURPOSE:	Reports geometry statistics for vector maps
-# COPYRIGHT:	(C) 2005, 2007 by MN and the GRASS Development Team
-#
-#		This program is free software under the GNU General Public
-#		License (>=v2). Read the file COPYING that comes with GRASS
-#		for details.
-#
-#############################################################################
-
-#%Module
-#%  description: Reports geometry statistics for vectors.
-#%  keywords: vector, report, statistics
-#%End
-#%Flag
-#% key: r
-#% description: Reverse sort the result
-#%End
-#%Flag
-#% key: s
-#% description: Sort the result
-#%End
-#%option
-#% key: map
-#% type: string
-#% gisprompt: old,vector,vector
-#% description: Name of input vector map
-#% required: yes
-#%end
-#%option
-#% key: layer
-#% type: integer
-#% answer: 1
-#% description: Layer number
-#% required: no
-#%end
-#%option
-#% key: option
-#% type: string
-#% description: Value to calculate
-#% options: area,length,coor
-#% required: yes
-#%end
-#%option
-#% key: units
-#% type: string
-#% description: mi(les),f(eet),me(ters),k(ilometers),a(cres),h(ectares),p(ercent)
-#% options: mi,miles,f,feet,me,meters,k,kilometers,a,acres,h,hectares,p,percent
-#% required: no
-#%end
-
-if  [ -z "$GISBASE" ] ; then
- echo "You must be in GRASS GIS to run this program." >&2
- exit 1
-fi   
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-  exec g.parser "$0" "$@"
-fi
-
-# check if we have awk
-if [ ! -x "`which awk`" ] ; then
-    echo "ERROR: awk required. Please install awk or gawk first." 1>&2
-    exit 1
-fi
-
-### setup enviro vars ###
-eval `g.gisenv`
-: ${GISBASE?} ${GISDBASE?} ${LOCATION_NAME?} ${MAPSET?}
-LOCATION=$GISDBASE/$LOCATION_NAME/$MAPSET
-
-### trap <ctrl>-<c> so that we can clean up tmp and exit
-trap 'rm -f "$TMP1" "$TMP2" "$TMP3" "$TMP4"; exit 1' 2 3 15
-
-# setting environment, so that sort works properly in all languages
-LC_ALL=C         # according to 'man sort'
-export LC_ALL
-LC_NUMERIC=C
-export LC_NUMERIC
-
-if [ $GIS_FLAG_R -eq 1 -a $GIS_FLAG_S -eq 1 ] ; then
-	g.message -e "Either -r or -s flag"
-	exit 1
-fi
-
-### secure temporary files:
-TMP1="`g.tempfile pid=$$`"
-TMP2="`g.tempfile pid=$$`"
-TMP3="`g.tempfile pid=$$`"
-TMP4="`g.tempfile pid=$$`"
-
-MAP=$GIS_OPT_MAP
-OPTION=$GIS_OPT_OPTION
-LAYER=$GIS_OPT_LAYER
-
-# does the input vector map exist?
-eval `g.findfile element=vector file=$GIS_OPT_MAP`
-if [ ! "$file" ] ; then
-   g.message -e "Vector map '$MAP' not found in mapset search path."
-   exit 1
-fi
-
-#test if the input vector has a table attached in the given layer
-v.info -c map=$MAP layer=$LAYER >/dev/null 2>&1
-if [ $? -eq 0 ] ; then
- TABLEEXISTS=1
-else
- TABLEEXISTS=0
-fi
-
-#fetch column names
-if [ $TABLEEXISTS -eq 1 ] ; then
- COLNAMES="`v.info -c map=$MAP layer=$LAYER | grep -v '^Displaying column type' | cut -d '|' -f2 | tr '\n' '|'`" >/dev/null 2>&1
-else
- COLNAMES="cat|"
-fi
-
-#special treatment for opt=coor parameter:
-if [ "$GIS_OPT_OPTION" = "coor" ] ; then
-  COLUMS="dummy1,dummy2,dummy3"
-  EXTRACOLNAMES="x|y|z"
-else
-  COLUMS="dummy1"
-  EXTRACOLNAMES="$OPTION"
-fi
-
-#check for optional units parameter:
-if [ -n "$GIS_OPT_UNITS" ] ; then
-   UNITSPARAM="units=$GIS_OPT_UNITS"
-   # reset to meters since percent are unsupported in v.to.db
-   if [ "$GIS_OPT_UNITS" = "p" -o "$GIS_OPT_UNITS" = "percent" ] ; then
-      UNITSPARAM="units=meters"
-   fi
-fi   
-
-## NOTE: we suppress -1 cat and 0 cat
-
-if [ $TABLEEXISTS -eq 1 ] ; then
-   v.db.select -c map="$MAP" layer="$LAYER" | sort -n -t'|' -k 1 | grep -v '^0' > "$TMP1"
-   if [ `wc -l "$TMP1" | awk '{print $1}'` -eq 0 ] ; then
-      KEY=`v.db.connect -g map="$GIS_OPT_MAP" fs=";" | grep -w "$LAYER" | cut -f3 -d';'`
-      g.message -e "There is a table connected to input vector map '$MAP', but\
-      there are no categories present in the key column '$KEY'. Consider using\
-      v.to.db to correct this."
-      exit 1
-   fi
-   #fetch the requested attribute sorted by cat:
-   v.to.db -p map="$MAP" opt="$OPTION" col="$COLUMS" $UNITSPARAM \
-	   layer="$LAYER" 2> /dev/null | grep -v '^cat' | grep -v '^-1' | grep -v '^0'\
-	   | sort -n -t'|' -k 1 | cut -d'|' -f2-4 > "$TMP2"
-   #make pre-table
-   paste -d'|' "$TMP1" "$TMP2" > "$TMP3"
-else
-    v.category input="$MAP" layer="$LAYER" option=print | sort -n | uniq | \
-        grep -v '^-1' | grep -v '^0' > "$TMP1"
-    #make pre-table
-    v.to.db -p map="$MAP" opt="$OPTION" col="$COLUMS" $UNITSPARAM \
-	   layer="$LAYER" 2> /dev/null | grep -v '^cat' | grep -v '^-1' | grep -v '^0'\
-	   | sort -n -t'|' -k 1 > "$TMP3"
-
-fi
-
-# print table header
-echo "$COLNAMES$EXTRACOLNAMES"
-
-#make and print the table:
-NUMCOLS=`echo "$COLNAMES$EXTRACOLNAMES" | tr -s '|' ' ' | wc -w | awk '{print $1}'`
-
-# calculate percents if requested
-if  [ -n "$GIS_OPT_UNITS" ] ; then
-    if [ "$GIS_OPT_UNITS" = "p" -o "$GIS_OPT_UNITS" = "percent" ] ; then
-    
-       # calculate total area value
-       AREATOT=`cat "$TMP3" | cut -d'|' -f$NUMCOLS | awk  -F '|' 'BEGIN {sum = 0.0}
-       NR == 1{}
-               {sum += $1}
-       END{
-       print sum
-       }'`
-
-       # calculate area percentages
-       cat "$TMP3" | cut -d'|' -f$NUMCOLS | awk '{printf "%f\n", $1/'$AREATOT' * 100.}'  > "$TMP4"
-       paste -d'|' "$TMP1" "$TMP4" > "$TMP3"
-    fi
-fi
-
-if [ $GIS_FLAG_S -eq 1 ] ; then
-	# sort
-	cat "$TMP3" | sort -n -t'|' -k${NUMCOLS} -k1
-else
-	if [ $GIS_FLAG_R -eq 1 ] ; then
-	# reverse sort
-	cat "$TMP3" | sort -n -r -t'|' -k${NUMCOLS} -k1
-        else
-	   # no sort (order by cat)
-	   cat "$TMP3"
-        fi
-fi
-
-#cleanup:
-rm -f "$TMP1"
-rm -f "$TMP2"
-rm -f "$TMP3"
-rm -f "$TMP4"
-
-exit 0

Deleted: grass/trunk/scripts/v.what.vect/v.what.vect
===================================================================
--- grass/trunk/scripts/v.what.vect/v.what.vect	2008-11-07 22:12:12 UTC (rev 34188)
+++ grass/trunk/scripts/v.what.vect/v.what.vect	2008-11-07 22:15:08 UTC (rev 34189)
@@ -1,89 +0,0 @@
-#!/bin/sh
-#
-############################################################################
-#
-# MODULE:       v.what.vect
-# AUTHOR(S):    Markus Neteler
-# PURPOSE:      Uploads attributes at the location of vector points to the table.
-# COPYRIGHT:    (C) 2005 by the GRASS Development Team
-#
-#               This program is free software under the GNU General Public
-#               License (>=v2). Read the file COPYING that comes with GRASS
-#               for details.
-#
-#############################################################################
-
-#%Module
-#%  description: Uploads vector values at positions of vector points to the table.
-#%  keywords: vector, database, attribute table
-#%End
-
-#%option
-#% key: vector
-#% type: string
-#% key_desc: name
-#% gisprompt: old,vector,vector
-#% description: Points vector map to modify
-#% required : yes
-#%end
-#%option
-#% key: layer
-#% type: integer
-#% description: Layer in the vector to be modified
-#% answer: 1
-#% required : no
-#%end
-#%option
-#% key: column
-#% type: string
-#% description: Column to be updated with the query result
-#% required : yes
-#%end
-
-#%option
-#% key: qvector
-#% type: string
-#% key_desc: name
-#% gisprompt: old,vector,vector
-#% description: Vector map to be queried
-#% required : yes
-#%end
-#%option
-#% key: qlayer
-#% type: integer
-#% description: Layer of the query vector containing data
-#% answer: 1
-#% required : no
-#%end
-#%option
-#% key: qcolumn
-#% type: string
-#% description: Column to be queried
-#% required : yes
-#%end
-#%option
-#% key: dmax
-#% type: double
-#% description: Maximum query distance in map units
-#% answer: 0.0
-#% required: no
-#%end
-
-
-if  [ -z "$GISBASE" ] ; then
-    echo "You must be in GRASS GIS to run this program." >&2
- exit 1
-fi
-
-if [ "$1" != "@ARGS_PARSED@" ] ; then
-    exec g.parser "$0" "$@"
-fi
-
-exec v.distance from="$GIS_OPT_VECTOR" \
-	to="$GIS_OPT_QVECTOR" \
-	column="$GIS_OPT_COLUMN" \
-	to_column="$GIS_OPT_QCOLUMN" \
-	upload=to_attr \
-	dmax=$GIS_OPT_DMAX \
-	from_layer=$GIS_OPT_LAYER \
-	to_layer=$GIS_OPT_QLAYER



More information about the grass-commit mailing list