1db.in.ogr(1) Grass User's Manual db.in.ogr(1)
2
3
4
6 db.in.ogr - Imports attribute tables in various formats.
7
9 database, import, attribute table
10
12 db.in.ogr
13 db.in.ogr --help
14 db.in.ogr input=name [db_table=name] [output=name] [key=string]
15 [encoding=string] [--overwrite] [--help] [--verbose] [--quiet]
16 [--ui]
17
18 Flags:
19 --overwrite
20 Allow output files to overwrite existing files
21
22 --help
23 Print usage summary
24
25 --verbose
26 Verbose module output
27
28 --quiet
29 Quiet module output
30
31 --ui
32 Force launching GUI dialog
33
34 Parameters:
35 input=name [required]
36 Table file to be imported or DB connection string
37
38 db_table=name
39 Name of table from given DB to be imported
40
41 output=name
42 Name for output table
43
44 key=string
45 Name for auto-generated unique key column
46
47 encoding=string
48 Encoding value for attribute data
49
51 db.in.ogr imports attribute tables in various formats as supported by
52 the OGR library on the local system (DBF, CSV, PostgreSQL, SQLite,
53 MySQL, ODBC, etc.). Optionally a unique key (ID) column can be added to
54 the table.
55
57 Import CSV file
58 Limited type recognition can be done for Integer, Real, String, Date,
59 Time and DateTime columns through a descriptive file with same name as
60 the CSV file, but .csvt extension (see details here).
61 # NOTE: create koeppen_gridcode.csvt first for automated type recognition
62 db.in.ogr input=koeppen_gridcode.csv output=koeppen_gridcode
63 db.select table=koeppen_gridcode
64
65 Import DBF table
66 Import of a DBF table with additional unique key column (e.g., needed
67 for v.in.db).
68 db.in.ogr input=/path/to/mydata.dbf output=census_raleigh key=myid
69 db.describe -c census_raleigh
70
71 Import of a SQLite table
72 db.in.ogr input=/path/to/sqlite.db db_table=census_raleigh output=census_raleigh
73
74 Import of a PostgreSQL table
75 # HINT: if the database contains spatial tables, but you want to import a non-spatial
76 table, set the environmental variable PG_LIST_ALL_TABLES to YES before importing
77 db.in.ogr input="PG:host=localhost dbname=ecad user=neteler" \
78 db_table=ecad_verona_tmean output=ecad_verona_tmean
79 db.select table=ecad_verona_tmean
80 db.describe -c ecad_verona_tmean
81
82 Import XLS file
83 To force reading headers, define environmental variable OGR_XLS_HEAD‐
84 ERS=’FORCE’. Parameter db_table refers to the list within XLS file.
85 export OGR_XLS_HEADERS=’FORCE’
86 db.in.ogr input=address.xls db_table=address_data
87
89 db.select, v.in.ogr, v.in.db
90
91 GRASS SQL interface
92
94 Markus Neteler
95
96 Last changed: $Date: 2015-12-17 15:38:13 +0100 (Thu, 17 Dec 2015) $
97
99 Available at: db.in.ogr source code (history)
100
101 Main index | Database index | Topics index | Keywords index | Graphical
102 index | Full index
103
104 © 2003-2019 GRASS Development Team, GRASS GIS 7.6.0 Reference Manual
105
106
107
108GRASS 7.6.0 db.in.ogr(1)