[GRASS-SVN] r30404 - grass/trunk/scripts/v.db.join
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Feb 29 16:53:27 EST 2008
Author: hamish
Date: 2008-02-29 16:53:27 -0500 (Fri, 29 Feb 2008)
New Revision: 30404
Modified:
grass/trunk/scripts/v.db.join/v.db.join
Log:
bugfix: correct use of v.db.describe for multi-layer
Modified: grass/trunk/scripts/v.db.join/v.db.join
===================================================================
--- grass/trunk/scripts/v.db.join/v.db.join 2008-02-29 21:52:23 UTC (rev 30403)
+++ grass/trunk/scripts/v.db.join/v.db.join 2008-02-29 21:53:27 UTC (rev 30404)
@@ -73,18 +73,21 @@
PROG=`basename $0`
-driver="`v.db.connect -g $GIS_OPT_MAP layer=$GIS_OPT_LAYER | cut -d' ' -f5`"
-database="`v.db.connect -g $GIS_OPT_MAP layer=$GIS_OPT_LAYER | cut -d' ' -f4`"
+driver=`v.db.connect -g map="$GIS_OPT_MAP" | grep "^$GIS_OPT_LAYER " | cut -d' ' -f5`
+database=`v.db.connect -g map="$GIS_OPT_MAP" | 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 "$GIS_OPT_MAP" layer="$GIS_OPT_LAYER" | cut -d' ' -f2`
+
+maptable=`v.db.connect -g map="$GIS_OPT_MAP" | 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
More information about the grass-commit
mailing list