[GRASS-dev] G7: v.in.ascii problem with broken lines: Busy SQLITE db

Hi

when importing a (big) file into GRASS GIS 7 with some broken lines in
it, the import gets stuck at some point:

Importing points...
DBMI-SQLite driver error:
Error in sqlite3_prepare():
table occurrence_plantae has 6 columns but 5 values were supplied

DBMI-SQLite driver error:
Error in sqlite3_prepare():
table occurrence_plantae has 6 columns but 5 values were supplied

ERROR: Unable to insert new record: insert into occurrence_plantae values (
       29222, 4.75738, 51.79876, 'Plantae', 'Bryophyta')
WARNING: Busy SQLITE db, already waiting for 10 seconds...
WARNING: Busy SQLITE db, already waiting for 20 seconds...
WARNING: Busy SQLITE db, already waiting for 30 seconds...
WARNING: Busy SQLITE db, already waiting for 40 seconds...
WARNING: Busy SQLITE db, already waiting for 50 seconds...
WARNING: Busy SQLITE db, already waiting for 60 seconds...
WARNING: Busy SQLITE db, already waiting for 70 seconds...
WARNING: Busy SQLITE db, already waiting for 80 seconds...
WARNING: Busy SQLITE db, already waiting for 90 seconds...
WARNING: Busy SQLITE db, already waiting for 100 seconds...
...
CTRL-C

The reason is (I think) that it just calls G_fatal_error() in the
points.c file rather than shutting down the DBMI stuff properly,
closing files etc. before.

While at it:
I have started to implement a -i "ignore" flag to simply skip broken
lines. This doesn't fully work yet: "category out of range" but I am
not vector C expert enough to complete that.
We have 180 million lines to import and some are broken, so a -i flag
would be quite handy rather than manually identifying those lines.

Anyone able to help to solve both issues?

thanks,
Markus

(attachments)

v.in.ascii_skipflag.diff (2.67 KB)

On Wed, Nov 5, 2014 at 6:14 PM, Markus Neteler <neteler@osgeo.org> wrote:

Hi

when importing a (big) file into GRASS GIS 7 with some broken lines in
it, the import gets stuck at some point:

...

While at it:
I have started to implement a -i "ignore" flag to simply skip broken
lines. This doesn't fully work yet: "category out of range" but I am
not vector C expert enough to complete that.
We have 180 million lines to import and some are broken, so a -i flag
would be quite handy rather than manually identifying those lines.

Anyone able to help to solve both issues?

for the record, Markus Metz implemented it all in trunk and relbranch70.
Works nicely, thanks.

Markus