|
@@ -1,52 +1,73 @@
|
|
|
<h2>DESCRIPTION</h2>
|
|
|
|
|
|
<em>db.in.ogr</em> imports attribute tables in various formats as
|
|
|
-supported by the OGR driver on the local system (DBF, CSV,
|
|
|
-PostgreSQL, SQLite, MySQL, ODBC, etc.). Optionally a unique key (ID)
|
|
|
-column can be added to the table.
|
|
|
-
|
|
|
-<h2>NOTES</h2>
|
|
|
-
|
|
|
+supported by the <a href="http://gdal.org/ogr">OGR library</a> on the local system (DBF, CSV, PostgreSQL,
|
|
|
+SQLite, MySQL, ODBC, etc.). Optionally a unique <b>key</b> (ID) column can be
|
|
|
+added to the table.
|
|
|
|
|
|
<h2>EXAMPLES</h2>
|
|
|
|
|
|
-Import of a CSV table file:<br>
|
|
|
+<h3>Import CSV file</h3>
|
|
|
+
|
|
|
Limited type recognition can be done for Integer, Real, String, Date, Time and DateTime
|
|
|
columns through a descriptive file with same name as the CSV file, but .csvt extension
|
|
|
(see details <a href="http://www.gdal.org/ogr/drv_csv.html">here</a>).
|
|
|
-<p><div class="code"><pre>
|
|
|
+
|
|
|
+<div class="code"><pre>
|
|
|
# NOTE: create koeppen_gridcode.csvt first for type recognition
|
|
|
db.in.ogr dsn=koeppen_gridcode.csv output=koeppen_gridcode
|
|
|
db.select koeppen_gridcode
|
|
|
</pre></div>
|
|
|
|
|
|
-<p>Import of a DBF table with additional unique key column (e.g., needed for <em>v.in.db</em>):
|
|
|
-<p><div class="code"><pre>
|
|
|
-db.in.ogr dsn=$HOME/mydata.dbf output=census_raleigh key=myid
|
|
|
+<h3>Import DBF table</h3>
|
|
|
+
|
|
|
+Import of a DBF table with additional unique key column (e.g., needed
|
|
|
+for <em><a href="v.in.db.html">v.in.db</a></em>).
|
|
|
+
|
|
|
+<div class="code"><pre>
|
|
|
+db.in.ogr dsn=/path/to/mydata.dbf output=census_raleigh key=myid
|
|
|
db.describe -c census_raleigh
|
|
|
</pre></div>
|
|
|
|
|
|
-<p>Import of a SQLite table:
|
|
|
-<p><div class="code"><pre>
|
|
|
-db.in.ogr dsn=$HOME/sqlite/sqlite.db db_table=census_raleigh output=census_raleigh
|
|
|
+<h3>Import of a SQLite table</h3>
|
|
|
+
|
|
|
+<div class="code"><pre>
|
|
|
+db.in.ogr dsn=/path/to/sqlite.db db_table=census_raleigh output=census_raleigh
|
|
|
</pre></div>
|
|
|
|
|
|
-<p>Import of a PostgreSQL table:
|
|
|
-<p><div class="code"><pre>
|
|
|
+<h3>Import of a PostgreSQL table</h3>
|
|
|
+
|
|
|
+<div class="code"><pre>
|
|
|
db.in.ogr dsn="PG:host=localhost dbname=ecad user=neteler" \
|
|
|
db_table=ecad_verona_tmean output=ecad_verona_tmean
|
|
|
db.select ecad_verona_tmean
|
|
|
db.describe -c ecad_verona_tmean
|
|
|
</pre></div>
|
|
|
|
|
|
+<h3>Import XLS file</h3>
|
|
|
+
|
|
|
+To force reading headers, define environmental
|
|
|
+variable <tt>OGR_XLS_HEADERS='FORCE'</tt>. Parameter <b>db_table</b>
|
|
|
+refers to the list within XLS file.
|
|
|
+
|
|
|
+<div class="code"><pre>
|
|
|
+export OGR_XLS_HEADERS='FORCE'
|
|
|
+db.in.ogr dsn=address.xls db_table=address_data
|
|
|
+</pre></div>
|
|
|
|
|
|
<h2>SEE ALSO</h2>
|
|
|
|
|
|
-<em><a href="v.in.ogr.html">v.in.ogr</a></em><br>
|
|
|
-<em><a href="sql.html">GRASS SQL interface</a></em>
|
|
|
+<em>
|
|
|
+ <a href="v.in.ogr.html">v.in.ogr</a>,
|
|
|
+ <a href="v.in.db.html">v.in.db</a>
|
|
|
+</em>
|
|
|
+
|
|
|
+<p>
|
|
|
+<a href="sql.html">GRASS SQL interface</a>
|
|
|
|
|
|
<h2>AUTHOR</h2>
|
|
|
|
|
|
Markus Neteler
|
|
|
|
|
|
-<p><i>Last changed: $Date$</i>
|
|
|
+<p>
|
|
|
+<i>Last changed: $Date$</i>
|