.TH v.db.join 1grass "" "GRASS 6.4.2" "Grass User's Manual" .SH NAME \fI\fBv.db.join\fR\fR - Allows to join a table to a vector map table. .SH KEYWORDS vector, database, attribute table .SH SYNOPSIS \fBv.db.join\fR .br \fBv.db.join help\fR .br \fBv.db.join map\fR=\fIname\fR [\fBlayer\fR=\fIinteger\fR] \fBcolumn\fR=\fIstring\fR \fBotable\fR=\fIstring\fR \fBocolumn\fR=\fIstring\fR [--\fBverbose\fR] [--\fBquiet\fR] .SS Parameters: .IP "\fBmap\fR=\fIname\fR" 4m .br Vector map to which to join other table .IP "\fBlayer\fR=\fIinteger\fR" 4m .br Layer where to join .br Default: \fI1\fR .IP "\fBcolumn\fR=\fIstring\fR" 4m .br Join column in map table .IP "\fBotable\fR=\fIstring\fR" 4m .br Other table name .IP "\fBocolumn\fR=\fIstring\fR" 4m .br Join column in other table .PP .SH DESCRIPTION \fIv.db.join\fR joins the content of another table into the connected attribute table of a vector map. .SH NOTES \fIv.db.join\fR is a front-end to \fIdb.execute\fR to allow easier usage. The vector attribute table must be stored in a SQL database (SQLite, PostgreSQL, MySQL, ODBC, ...). The DBF backend is not supported. Tables can be imported with \fIdb.in.ogr\fR. .PP The vector map-database connection(s) can be verified with \fIv.db.connect\fR. .SH EXAMPLE Joining the soil type explanations from table \fIsoils_legend\fR into the Spearfish soils map (download legend): \fC .DS .br g.copy vect=soils,mysoils .br .br # import legend table .br db.in.ogr soils_legend.csv out=soils_legend .br .br # get join column names .br v.info -c mysoils .br db.describe -c soils_legend .br .br # look at original table .br v.db.select mysoils .br cat|label .br 1|Aab .br 2|Ba .br 3|Bb .br 4|BcB .br 5|BcC .br ... .br .br # look at legend .br db.select soils_legend .br db.select soils_legend | head -7 .br id|shortname|longname .br 0|no data|no data .br 0|AaB|Alice fine sandy loam, 0 to 6 .br 0|Ba|Barnum silt loam .br 0|Bb|Barnum silt loam, channeled .br 0|BcB|Boneek silt loam, 2 to 6 .br 0|BcC|Boneek silt loam, 6 to 9 .br ... .br .br # join soils_legend into mysoils attribute table .br v.db.join mysoils col=label otable=soils_legend ocol=shortname .br .br # verification of join .br v.db.select mysoils .br cat|label|id|shortname|longname .br 1|Aab||| .br 2|Ba|2|Ba|Barnum silt loam .br 3|Bb|3|Bb|Barnum silt loam, channeled .br 4|BcB|4|BcB|Boneek silt loam, 2 to 6 .br 5|BcC|5|BcC|Boneek silt loam, 6 to 9 .br ... .br .DE \fR .SH SEE ALSO \fI db.execute, db.in.ogr, v.db.update .br GRASS SQL interface \fR .SH AUTHOR Markus Neteler .PP \fILast changed: $Date: 2011-11-08 10:42:51 +0100 (Tue, 08 Nov 2011) $\fR .PP Full index .PP © 2003-2011 GRASS Development Team