## DESCRIPTION

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

## EXAMPLES

### Import CSV file

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 here).

    # NOTE: create koeppen_gridcode.csvt first for type recognition
    db.in.ogr dsn=koeppen_gridcode.csv output=koeppen_gridcode
    db.select koeppen_gridcode

### Import DBF table

Import of a DBF table with additional unique key column (e.g., needed for v.in.db).

    db.in.ogr dsn=/path/to/mydata.dbf output=census_raleigh key=myid
    db.describe -c census_raleigh

### Import of a SQLite table

    db.in.ogr dsn=/path/to/sqlite.db db_table=census_raleigh output=census_raleigh

### Import of a PostgreSQL table

    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

### Import XLS file

To force reading headers, define environmental variable `OGR_XLS_HEADERS='FORCE'`. Parameter db_table refers to the list within XLS file.

    export OGR_XLS_HEADERS='FORCE'
    db.in.ogr dsn=address.xls db_table=address_data

## SEE ALSO

v.in.ogr, v.in.db

GRASS SQL interface

## AUTHOR

Markus Neteler

Last changed: $Date$