1v.db.addtable(1)              Grass User's Manual             v.db.addtable(1)
2
3
4

NAME

6       v.db.addtable   - Creates and connects a new attribute table to a given
7       layer of an existing vector map.
8

KEYWORDS

10       vector, attribute table, database
11

SYNOPSIS

13       v.db.addtable
14       v.db.addtable --help
15       v.db.addtable map=name  [table=string]    [layer=integer]    [key=name]
16       [columns=name  type[,name type,...]]   [--help]  [--verbose]  [--quiet]
17       [--ui]
18
19   Flags:
20       --help
21           Print usage summary
22
23       --verbose
24           Verbose module output
25
26       --quiet
27           Quiet module output
28
29       --ui
30           Force launching GUI dialog
31
32   Parameters:
33       map=name [required]
34           Name of vector map
35           Or data source for direct OGR access
36
37       table=string
38           Name of new attribute table (default: vector map name)
39
40       layer=integer
41           Layer number where to add new attribute table
42           Default: 1
43
44       key=name
45           Name of key column
46           Must refer to an integer column
47           Default: cat
48
49       columns=name type[,name type,...]
50           Name and type of the new column(s) (’name type [,name type, ...]’)
51           Types depend on database backend, but all support  VARCHAR(),  INT,
52           DOUBLE  PRECISION  and  DATE.  Example:  ’label varchar(250), value
53           integer’
54

DESCRIPTION

56       v.db.addtable creates and adds a new attribute table to a given  vector
57       map.  It  links  the table to the specified layer of the vector map. If
58       the vector map is not yet linked to any table, new a database  link  is
59       established based on the MAPSET database settings (see db.connect).
60

NOTES

62       v.db.addtable is a front-end to db.execute to allow easier usage.
63
64       v.db.addtable will only insert category values into the table for those
65       features which actually have a category value in  the  relevant  layer.
66       The  user  can add category values automatically by using v.category or
67       manually with wxGUI vector digitizer before running  v.db.addtable.  Or
68       one  can  run  v.db.addtable first and then use either a combinatino of
69       v.category + v.to.db or wxGUI vector  digitizer  to  add  the  relevant
70       lines to the table.
71
72       The supported types of columns depend on the database backend. However,
73       all backends should support VARCHAR, INT, DOUBLE PRECISION and DATE.
74
75       The existing database connection(s) can be verified with v.db.connect.
76

EXAMPLE

78       Adding a new attribute table with a single column to default layer 1:
79       g.copy vect=roadsmajor,myroads
80       v.db.addtable myroads columns="slope double precision"
81       v.db.connect -p myroads
82       v.info -c myroads
83
84       Adding a new attribute table with two columns to layer 2:
85       g.copy vect=roadsmajor,myroads
86       v.db.addtable myroads columns="slope double precision, roadname varchar(15)" layer=2
87       v.db.connect -p myroads
88       v.info -c myroads
89       v.info -c myroads layer=2
90

SEE ALSO

92        db.connect,  db.droptable,  db.execute,  v.db.addtable,  v.db.connect,
93       v.db.dropcolumn, v.db.droptable, v.db.select, v.db.update
94       GRASS SQL interface
95

AUTHOR

97       Markus Neteler
98
99       Last changed: $Date: 2018-06-14 05:19:32 +0200 (Thu, 14 Jun 2018) $
100

SOURCE CODE

102       Available at: v.db.addtable source code (history)
103
104       Main  index  | Vector index | Topics index | Keywords index | Graphical
105       index | Full index
106
107       © 2003-2019 GRASS Development Team, GRASS GIS 7.6.0 Reference Manual
108
109
110
111GRASS 7.6.0                                                   v.db.addtable(1)
Impressum