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

NAME

6       db.in.ogr  - Imports attribute tables in various formats.
7

KEYWORDS

9       database, import, attribute table
10

SYNOPSIS

12       db.in.ogr
13       db.in.ogr --help
14       db.in.ogr    input=name     [gdal_config=string]      [gdal_doo=string]
15       [db_table=name]    [output=name]     [key=string]     [encoding=string]
16       [--overwrite]  [--help]  [--verbose]  [--quiet]  [--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       gdal_config=string
39           GDAL configuration options
40           Comma-separated list of key=value pairs
41
42       gdal_doo=string
43           GDAL dataset open options
44           Comma-separated list of key=value pairs
45
46       db_table=name
47           Name of table from given DB to be imported
48
49       output=name
50           Name for output table
51
52       key=string
53           Name for auto-generated unique key column
54
55       encoding=string
56           Encoding value for attribute data
57

DESCRIPTION

59       db.in.ogr  imports  attribute tables in various formats as supported by
60       the OGR library on the local  system  (DBF,  CSV,  PostgreSQL,  SQLite,
61       MySQL, ODBC, etc.). Optionally a unique key (ID) column can be added to
62       the table.
63

EXAMPLES

65   Import CSV file
66       Limited type recognition can be done for Integer, Real,  String,  Date,
67       Time  and DateTime columns through a descriptive file with same name as
68       the CSV file, but .csvt extension (see details here).
69       # NOTE: create koeppen_gridcode.csvt first for automated type recognition
70       db.in.ogr input=koeppen_gridcode.csv output=koeppen_gridcode
71       db.select table=koeppen_gridcode
72
73   Import DBF table
74       Import of a DBF table with additional unique key column  (e.g.,  needed
75       for v.in.db).
76       db.in.ogr input=/path/to/mydata.dbf output=census_raleigh key=myid
77       db.describe -c census_raleigh
78
79   Import of a SQLite table
80       db.in.ogr input=/path/to/sqlite.db db_table=census_raleigh output=census_raleigh
81
82   Import of a PostgreSQL table
83       # HINT: if the database contains spatial tables, but you want to import a non-spatial
84       table, set the environmental variable PG_LIST_ALL_TABLES to YES before importing
85       db.in.ogr input="PG:host=localhost dbname=ecad user=neteler" \
86                 db_table=ecad_verona_tmean output=ecad_verona_tmean
87       db.select table=ecad_verona_tmean
88       db.describe -c ecad_verona_tmean
89
90   Import XLS file
91       To  force  reading headers, define environmental variable OGR_XLS_HEAD‐
92       ERS=’FORCE’. Parameter db_table refers to the list within XLS file.
93       export OGR_XLS_HEADERS=’FORCE’
94       db.in.ogr input=address.xls db_table=address_data
95

SEE ALSO

97        db.select, v.in.ogr, v.in.db
98
99       GRASS SQL interface
100

AUTHOR

102       Markus Neteler
103

SOURCE CODE

105       Available at: db.in.ogr source code (history)
106
107       Accessed: Mon Jun 20 16:47:44 2022
108
109       Main index | Database index | Topics index | Keywords index | Graphical
110       index | Full index
111
112       © 2003-2022 GRASS Development Team, GRASS GIS 8.2.0 Reference Manual
113
114
115
116GRASS 8.2.0                                                       db.in.ogr(1)
Impressum