File: db.out.ogr.html

package info (click to toggle)
grass 8.4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 277,040 kB
  • sloc: ansic: 460,798; python: 227,732; cpp: 42,026; sh: 11,262; makefile: 7,007; xml: 3,637; sql: 968; lex: 520; javascript: 484; yacc: 450; asm: 387; perl: 157; sed: 25; objc: 6; ruby: 4
file content (52 lines) | stat: -rw-r--r-- 1,463 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<h2>DESCRIPTION</h2>

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

<h2>EXAMPLES</h2>

<h3>Export of GRASS GIS attribute table to a CSV table file (default format)</h3>

<div class="code"><pre>
db.out.ogr input=precip_30ynormals output=precip_30ynormals.csv
</pre></div>

<h3>Export of a GRASS GIS attribute table to a DBF table</h3>

<div class="code"><pre>
db.out.ogr input=precip_30ynormals output=precip_30ynormals.dbf format=DBF
</pre></div>

<h3>Export of GRASS GIS attribute table into a PostgreSQL table</h3>

<div class="code"><pre>
db.out.ogr input=precip_30ynormals \
           output="PG:host=localhost dbname=meteo user=neteler" \
           format=PostgreSQL
# verify
echo "SELECT * FROM precip_30ynormals" | psql meteo
</pre></div>

<h2>SEE ALSO</h2>

<em>
<a href="db.tables.html">db.tables</a>
</em>
<p>
<em>
<a href="sql.html">GRASS SQL interface</a>
</em>

<h2>AUTHORS</h2>

Markus Neteler<br>
Converted to Python by Glynn Clements