[GRASS-dev] Problem v.in.ascii (GRASS6.4.0RC4)

Markus Neteler neteler at osgeo.org
Tue May 5 17:43:00 EDT 2009


Hi Roberto,

I can reproduce the problem:

GRASS 6.5.svn (spearfish60):/tmp > v.in.ascii -z input=profilo_30.txt
output=name_output format=point fs=" "  skip=0 x=1 y=2 z=3 cat=0
Scanning input for column types...
Maximum input row length: 35
Maximum number of columns: 10
Minimum number of columns: 4
Importing points...
 100%
Populating table...
dbmi: Protocol error
...

No good.

GRASS 6.5.svn (spearfish60):/tmp > g.gisenv set=DEBUG=3

GRASS 6.5.svn (spearfish60):/tmp > v.in.ascii -z input=profilo_30.txt
output=name_output format=point fs=" "  skip=0 x=1 y=2 z=3 cat=0 --o
D2/3: Vect_open_new(): name = name_output
...
D2/3: load_table_head(): tab = 30,
/home/neteler/grassdata/spearfish60/neteler/dbf//name_output.dbf
D3/3: Doing SQL command <3> on DBF table... (see include/sqlp.h)
D2/3: load_table(): tab = 30
 100%
Populating table...
D2/3: Commit transaction
...
D2/3: save_table 27
D2/3: save_table 28
D2/3: save_table 29
D2/3: save_table 30
D2/3: Write table to tempfile:
'/home/neteler/grassdata/spearfish60/neteler/.tmp/host550/17010.dbf'
D2/3: Write 108 rows
dbmi: Protocol error
D3/3: Vect_build(): build = 4
Building topology for vector map <name_output>
...

The file /home/neteler/grassdata/spearfish60/neteler/.tmp/host550/17010.dbf
is only of
1 byte size, so corrupted.

Using the SQLite driver, I get a more useful error message:

DBMI-SQLite driver error:
Error in sqlite3_prepare():
table name_output has 11 columns but 10 values were supplied
D2/3: G__home home = /home/neteler
ERROR: Unable to insert new record: insert into name_output values ( 1,
       715514.14, 93561.67, 304.19, '53', null, null, null, null, null)

As we see: 5 empty columns are recognized.
This is because there are white spaces at the end of the first row,
maybe elsewhere, too.

So: GRASS is working but the error trapping in the DBF driver isn't
that good (the SQLite driver is better here).

Solution: polish the data file...

Markus
PS: the * in some rows will also cause problems.

On Tue, May 5, 2009 at 10:55 PM, roberto.marzocchi
<roberto.marzocchi at gmail.com> wrote:
> I have the same problem in the command line (using fs='  ') and using the
> GUI without quoting
> maybe i have a problem with libraries....?
>
> R
>
>
>
> Moritz Lennert ha scritto:
>>
>> On 05/05/09 17:45, roberto marzocchi wrote:
>>>
>>> in attached the input file
>>>
>>> in grass6.3.0 the command run, the problem is only with the last grass
>>> version
>>
>> Have you tried quoting the fs, i.e.:
>>
>> v.in.ascii -z input=fle_input  output=name_output format=point fs=' '
>> skip=0 x=1 y=2 z=3 cat=0 --overwrite
>>
>> Running it without quoting, I get:
>>
>> ERROR: y column number > minimum last column number
>>       (incorrect field separator?)
>>
>> With quoting it works (in the grass6 development branch).
>>
>> How are you running this command ? On the command line ? In the GUI ?
>>
>> Moritz
>>
>>>
>>> R
>>>
>>>
>>>
>>>
>>>
>>>
>>> 2009/5/5 Moritz Lennert <mlennert at club.worldonline.be
>>> <mailto:mlennert at club.worldonline.be>>
>>>
>>>    On 05/05/09 14:07, roberto marzocchi wrote:
>>>
>>>        v.in.ascii -z input=fle_input  output=name_output format=point
>>>        fs=  skip=0 x=1 y=2 z=3 cat=0 --overwrite --quiet
>>>
>>>        Output:
>>>        ******************************************************
>>>        Segmentation fault
>>>        dbmi: Protocol error
>>>        ******************************************************
>>>
>>>        Grass import correctly the points, but don't create the
>>>        associated table. anyone know the reason?
>>>
>>>
>>>    Is there any attribute data contained in the input file ? It would
>>>    help if you sent us at least the first few lines of the data.
>>>
>>>    Also fs= seems weird. What is the field separator in the file ?
>>>
>>>    Moritz
>>>
>>>
>>>
>>>
>>>
>>>
>>> Please consider the environment before printing this mail note!
>>>
>>
>>
>
> _______________________________________________
> grass-dev mailing list
> grass-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-dev
>


More information about the grass-dev mailing list