[GRASS-user] Re: Help with importing points and their attributes

Dear Sela,

Thank you for your advice. I have re-run the import having corrected the
format as you suggest, using the command below:

v.in.ascii -z -n input=/home/rebecca/lidar/08.txt output=test_08_attribute
format=point {fs= } skip=0 {columns=columns= 'x double precision, y double
precision, z double precision, i double precision'} x=1 y=2 z=3 cat=0
--overwrite

However I now get the error message

"DBMI-SQLite driver error:
Unable to open database
</home/rebecca/Documents/Mapping/Grassdata/Salisbury/PERMANENT/sqlite> by
driver <sqlite>

Unable to open database: unable to open database file
Unable to open database
</home/rebecca/Documents/Mapping/Grassdata/Salisbury/PERMANENT/sqlite> by
driver <sqlite>"

so it maybe a problem with my database driver rather than the input file? I
have a folder called sqlite but no files within it...

Once again thanks for your help, any more suggestions about how to fix this
are welcome!

Rebecca
--
View this message in context: http://n2.nabble.com/Help-with-importing-points-and-their-attributes-tp4460359p4460750.html
Sent from the Grass - Users mailing list archive at Nabble.com.

What does 'db.connect -p' show?

Mark

On Tue, Jan 26, 2010 at 9:02 AM, Rebecca Bennett <rabennett@ymail.com> wrote:

Dear Sela,

Thank you for your advice. I have re-run the import having corrected the
format as you suggest, using the command below:

v.in.ascii -z -n input=/home/rebecca/lidar/08.txt output=test_08_attribute
format=point {fs= } skip=0 {columns=columns= 'x double precision, y double
precision, z double precision, i double precision'} x=1 y=2 z=3 cat=0
--overwrite

However I now get the error message

"DBMI-SQLite driver error:
Unable to open database
</home/rebecca/Documents/Mapping/Grassdata/Salisbury/PERMANENT/sqlite> by
driver <sqlite>

Unable to open database: unable to open database file
Unable to open database
</home/rebecca/Documents/Mapping/Grassdata/Salisbury/PERMANENT/sqlite> by
driver <sqlite>"

so it maybe a problem with my database driver rather than the input file? I
have a folder called sqlite but no files within it...

Once again thanks for your help, any more suggestions about how to fix this
are welcome!

Rebecca
--
View this message in context: http://n2.nabble.com/Help-with-importing-points-and-their-attributes-tp4460359p4460750.html
Sent from the Grass - Users mailing list archive at Nabble.com.
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Hi Mark

db.connect -p shows

driver:sqlite
database:$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite
schema:
group:

Rebecca
--
View this message in context: http://n2.nabble.com/Help-with-importing-points-and-their-attributes-tp4460359p4460798.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Looking at mine, the only difference I see is that the name of the
database is missing a ".db" extension. Please let me know if that
makes a difference.

Mark

On Tue, Jan 26, 2010 at 9:09 AM, Rebecca Bennett <rabennett@ymail.com> wrote:

Hi Mark

db.connect -p shows

driver:sqlite
database:$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite
schema:
group:

Rebecca
--
View this message in context: http://n2.nabble.com/Help-with-importing-points-and-their-attributes-tp4460359p4460798.html
Sent from the Grass - Users mailing list archive at Nabble.com.
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

M S wrote:

Looking at mine, the only difference I see is that the name of the
database is missing a ".db" extension. Please let me know if that
makes a difference.
  

For the sqlite driver, the database must be a file, not a directory. The GRASS standard is sqlite.db I think. I would delete the folder sqlite and reset the database connection either with

db.connect driver=sqlite database=$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite.db

or hacking the VAR file (dangerous). In theory, GRASS should create a new database if not existing.

Hope that helps,

Markus

Mark

On Tue, Jan 26, 2010 at 9:09 AM, Rebecca Bennett <rabennett@ymail.com> wrote:
  

Hi Mark

db.connect -p shows

driver:sqlite
database:$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite
schema:
group:

Rebecca
--
View this message in context: http://n2.nabble.com/Help-with-importing-points-and-their-attributes-tp4460359p4460798.html
Sent from the Grass - Users mailing list archive at Nabble.com.
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Genius, thanks for that suggestion Mark!

Having changed the database to have a .db at the end I re-ran the import,
getting the following output and error

"Scanning input for column types...

Maximum input row length: 35
Minimum number of columns: 4

Maximum number of columns: 4

DBMI-SQLite driver error:
Error in sqlite3_prepare():
near "=": syntax error
Table <test_08_attribute> linked to vector map <test_08_attribute> does not
exist
Unable to create table: create table test_08_attribute ( cat integer,
columns= 'x double precision, y double precision, z double precision, i
double precision' )"

Does this mean it is not able to create the table now it can see the
database? Any ideas for a fix?

Many thanks

Rebecca
--
View this message in context: http://n2.nabble.com/Help-with-importing-points-and-their-attributes-tp4460359p4460920.html
Sent from the Grass - Users mailing list archive at Nabble.com.

OK, sorry I spotted an obvious error looking at that again. Removing the
extra "columns=" I ran the command again

v.in.ascii -z -n input=/home/rebecca/lidar/08.txt output=test_08_attribute
format=point {fs= } skip=0 {columns= 'x double precision, y double
precision, z double precision, i double precision'} x=1 y=2 z=3 cat=0
--overwrite

I now have the error

Table <test_08_attribute> linked to vector map <test_08_attribute> does not
exist
Number of columns defined (1) does not match number of columns (4) in input

Any thoughts appreciated!

Rebecca
--
View this message in context: http://n2.nabble.com/Help-with-importing-points-and-their-attributes-tp4460359p4460940.html
Sent from the Grass - Users mailing list archive at Nabble.com.

OK I think I have cracked this by removing the quotation marks from the
column descriptors in the command :blush:. I now have a point file with
attributes and a database that works (hopefully).

Many thanks to all who contributed suggestions,

Rebecca
--
View this message in context: http://n2.nabble.com/Help-with-importing-points-and-their-attributes-tp4460359p4461053.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On Tue, 26 Jan 2010, Rebecca Bennett wrote:

db.connect -p shows

driver:sqlite
database:$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite
schema:
group:

Rebecca,

   Allow me to suggest that you name your SQLite databases by project,
location, or other unique identifier. Naming the database with the
application's name can cause confusion for other applications.

Rich