[GRASS-user] db.in.ogr: multiple tables in one database

Rich Shepard rshepard at appl-ecosys.com
Fri Nov 20 19:07:06 EST 2009


   I have one location which has the coordinates/projection for five themes,
so I used v.in.ogr and v.in.e00 to load those data. I then converted the
.dbf files to .csv, created a single SQLite database, and imported all five
tables in the single db:

[rshepard at salmo /usr4/grassbase/Oregon]$ sqlite3 oregon.db 
SQLite version 3.6.20
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .tab
dams      highways  huc       lentic    lotic 
sqlite>

   Reading the db.in.ogr man page suggests that the module will extract a
specified table from a named database based on the SQLite example on that
man page:

db.in.ogr dsn=$HOME/sqlite/sqlite.db db_table=census_raleigh output=census_raleigh

   I tried to import all 5 tables simultaneously by putting the set of
db_table/output specifications on the single command line. This seemed to
have imported the first two tables, but not the last three. Thinking none
were imported, I tried each individually with the following results:

GRASS 6.4.0svn (Oregon):/usr4/grassbase/Oregon > db.in.ogr
dsn=/usr4/grassbase/Oregon/oregon.db db_table=dams output=dams
ERROR: Table <dams> already exists

GRASS 6.4.0svn (Oregon):/usr4/grassbase/Oregon > db.in.ogr
dsn=/usr4/grassbase/Oregon/oregon.db db_table=highways output=highways
ERROR: Table <highways> already exists

GRASS 6.4.0svn (Oregon):/usr4/grassbase/Oregon > db.in.ogr
dsn=/usr4/grassbase/Oregon/oregon.db db_table=huc output=huc 
WARNING: Column name changed: 'cat' -> 'cat_'
ERROR: Input DSN <huc> not found or not readable

GRASS 6.4.0svn (Oregon):/usr4/grassbase/Oregon > db.in.ogr
dsn=/usr4/grassbase/Oregon/oregon.db db_table=lentic output=lentic
WARNING: Column name changed: 'cat' -> 'cat_'
ERROR: Input DSN <lentic> not found or not readable

GRASS 6.4.0svn (Oregon):/usr4/grassbase/Oregon > db.in.ogr
dsn=/usr4/grassbase/Oregon/oregon.db db_table=lotic output=lotic 
WARNING: Column name changed: 'cat' -> 'cat_'
ERROR: Input DSN <lotic> not found or not readable

   Where do I start looking for the reason(s) the latter three tables will
not import?

Rich






More information about the grass-user mailing list