1db.out.ogr(1)               GRASS GIS User's Manual              db.out.ogr(1)
2
3
4

NAME

6       db.out.ogr  - Exports attribute tables into various formats.
7

KEYWORDS

9       database, export, output, attribute table
10

SYNOPSIS

12       db.out.ogr
13       db.out.ogr --help
14       db.out.ogr  input=name output=name  [layer=string]  format=string  [ta‐
15       ble=name]   [--overwrite]  [--help]  [--verbose]  [--quiet]  [--ui]
16
17   Flags:
18       --overwrite
19           Allow output files to overwrite existing files
20
21       --help
22           Print usage summary
23
24       --verbose
25           Verbose module output
26
27       --quiet
28           Quiet module output
29
30       --ui
31           Force launching GUI dialog
32
33   Parameters:
34       input=name [required]
35           GRASS table name
36           Or data source for direct OGR access
37
38       output=name [required]
39           Output table file name or DB connection string
40
41       layer=string
42           Layer number or name
43           Vector features can have category values in different layers.  This
44           number determines which layer to use. When used with direct OGR ac‐
45           cess this is the layer name.
46           Default: 1
47
48       format=string [required]
49           Table format
50           Options: CSV, DBF, GML, MySQL, PostgreSQL, SQLite
51           Default: CSV
52
53       table=name
54           Name for output table (default: input name)
55

DESCRIPTION

57       db.out.ogr exports GRASS GIS attribute tables into various  formats  as
58       supported  by the OGR driver on the local system (CSV, DBF, PostgreSQL,
59       SQLite, MySQL, ODBC, etc.).
60
61       The output parameter is used to define the output  file  name  (if  the
62       path  is  not  defined, the module will attempt to write to the current
63       directory). In case of a database connection as output, the  connection
64       string has to be specified.
65
66       The  layer parameter is needed if the attribute table to be exported is
67       linked as non-default layer to a vector map.
68

EXAMPLES

70   Export of GRASS GIS attribute table to a CSV table file (default format)
71       db.out.ogr input=precip_30ynormals output=precip_30ynormals.csv
72
73   Export of a GRASS GIS attribute table to a DBF table
74       db.out.ogr input=precip_30ynormals output=precip_30ynormals.dbf format=DBF
75
76   Export of GRASS GIS attribute table into a PostgreSQL table
77       db.out.ogr input=precip_30ynormals \
78               output="PG:host=localhost dbname=meteo user=neteler" \
79                  format=PostgreSQL
80       # verify
81       echo "SELECT * FROM precip_30ynormals" | psql meteo
82

SEE ALSO

84        db.tables
85
86        GRASS SQL interface
87

AUTHORS

89       Markus Neteler
90       Converted to Python by Glynn Clements
91

SOURCE CODE

93       Available at: db.out.ogr source code (history)
94
95       Accessed: Saturday Jan 21 21:17:01 2023
96
97       Main index | Database index | Topics index | Keywords index | Graphical
98       index | Full index
99
100       © 2003-2023 GRASS Development Team, GRASS GIS 8.2.1 Reference Manual
101
102
103
104GRASS 8.2.1                                                      db.out.ogr(1)
Impressum