v.db.addtable1grass
Creates and connects a new attribute table to a given layer of an existing vector map.
Usage
v.db.addtable
v.db.addtable --help
Keywords
vector, attribute table, database
Overview
v.db.addtable creates and adds a new attribute table to a given vector map. It links the table to the specified layer of the vector map. If the vector map is not yet linked to any table, new a database link is established based on the MAPSET database settings (see db.connect).
Notes
v.db.addtable is a front-end to db.execute to allow easier usage.
v.db.addtable will only insert category values into the table for those features which actually have a category value in the relevant layer. The user can add category values automatically by using v.category or manually with wxGUI vector digitizer before running v.db.addtable. Or one can run v.db.addtable first and then use either a combinatino of v.category + v.to.db or wxGUI vector digitizer to add the relevant lines to the table.
The supported types of columns depend on the database backend. However, all backends should support VARCHAR, INT, DOUBLE PRECISION and DATE.
The existing database connection(s) can be verified with v.db.connect.
Examples
Adding a new attribute table with a single column to default layer 1:
g.copy vect=roadsmajor,myroadsv.db.addtable myroads columns="slope double precision"v.db.connect -p myroadsv.info -c myroads
Adding a new attribute table with two columns to layer 2:
g.copy vect=roadsmajor,myroadsv.db.addtable myroads columns="slope double precision, roadname varchar(15)" layer=2v.db.connect -p myroadsv.info -c myroadsv.info -c myroads layer=2
Source code
Available at: v.db.addtable source code (history)
Accessed: Monday Feb 24 17:51:45 2025
Main index | Vector index | Topics index | Keywords index | Graphical index | Full index
© 2003-2025 GRASS Development Team, GRASS GIS 8.4.1 Reference Manual
Releases
9 releases since Debian 5.0 (Lenny); the text changed 8 times.