1v.db.join(1) Grass User's Manual v.db.join(1)
2
3
4
6 v.db.join - Allows to join a table to a vector map table.
7
9 vector, database, attribute table
10
12 v.db.join
13 v.db.join help
14 v.db.join map=name [layer=integer] column=string otable=string ocol‐
15 umn=string [--verbose] [--quiet]
16
17 Parameters:
18 map=name
19 Vector map to which to join other table
20
21 layer=integer
22 Layer where to join
23 Default: 1
24
25 column=string
26 Join column in map table
27
28 otable=string
29 Other table name
30
31 ocolumn=string
32 Join column in other table
33
35 v.db.join joins the content of another table into the connected
36 attribute table of a vector map.
37
39 v.db.join is a front-end to db.execute to allow easier usage. The vec‐
40 tor attribute table must be stored in a SQL database (SQLite, Post‐
41 greSQL, MySQL, ODBC, ...). The DBF backend is not supported. Tables can
42 be imported with db.in.ogr.
43
44 The vector map-database connection(s) can be verified with v.db.con‐
45 nect.
46
48 Joining the soil type explanations from table soils_legend into the
49 Spearfish soils map (download legend):
50 g.copy vect=soils,mysoils
51 # import legend table
52 db.in.ogr soils_legend.csv out=soils_legend
53 # get join column names
54 v.info -c mysoils
55 db.describe -c soils_legend
56 # look at original table
57 v.db.select mysoils
58 cat|label
59 1|Aab
60 2|Ba
61 3|Bb
62 4|BcB
63 5|BcC
64 # look at legend
65 db.select soils_legend
66 db.select soils_legend | head -7
67 id|shortname|longname
68 0|no data|no data
69 0|AaB|Alice fine sandy loam, 0 to 6
70 0|Ba|Barnum silt loam
71 0|Bb|Barnum silt loam, channeled
72 0|BcB|Boneek silt loam, 2 to 6
73 0|BcC|Boneek silt loam, 6 to 9
74 # join soils_legend into mysoils attribute table
75 v.db.join mysoils col=label otable=soils_legend ocol=shortname
76 # verification of join
77 v.db.select mysoils
78 cat|label|id|shortname|longname
79 1|Aab|||
80 2|Ba|2|Ba|Barnum silt loam
81 3|Bb|3|Bb|Barnum silt loam, channeled
82 4|BcB|4|BcB|Boneek silt loam, 2 to 6
83 5|BcC|5|BcC|Boneek silt loam, 6 to 9
84
85
87 db.execute, db.in.ogr, v.db.update
88 GRASS SQL interface
89
91 Markus Neteler
92
93 Last changed: $Date: 2007-11-25 16:51:28 +0100 (Sun, 25 Nov 2007) $
94
95 Full index
96
97 © 2003-2008 GRASS Development Team
98
99
100
101GRASS 6.3.0 v.db.join(1)