[GRASS5] [bug #3338] (grass) v.in.ascii and MySQL do not function together as expected

Request Tracker grass-bugs at intevation.de
Thu Jun 9 09:15:21 EDT 2005


this bug's URL: http://intevation.de/rt/webrt?serial_num=3338
-------------------------------------------------------------------------

Subject: v.in.ascii and MySQL do not function together as expected

Platform: GNU/Linux/i386
grass obtained from: Trento Italy site
grass binary for platform: Compiled from Sources
GRASS Version: grass-6.1.cvs_src_snapshot_2005_06_04

When importing ascii files with v.in.ascii, the database is not created according to the manpage documentation. With this example:

echo "41.9613888888|12.45027777|Villa di Lucio Vero" | v.in.ascii output=LucioVero x=1 y=2 cat=0 z=0 columns='x double, y double, Name varchar(100)'

which is quite much the same as in the manpage, the result is:

Maximum input row length: 46
Maximum number of columns: 3
Minimum number of columns: 3
column: 1  type: double
column: 2  type: double
column: 3  type: string  length: 19
ERROR: Number of columns defined (0) does not match number of columns (3)
       in input

The table in the database is created correctly, with cat integer as first and then these three fields just as they are written above.

A second example:

echo "41.9613888888|12.45027777|Villa di Lucio Vero" | v.in.ascii output=LucioVero

This functions ok, and the results shown are:

Maximum input row length: 46
Maximum number of columns: 3
Minimum number of columns: 3
column: 1  type: double
column: 2  type: double
column: 3  type: string  length: 19
Building topology ...
1 primitives registered
Building areas:  100%
0 areas built
0 isles built
Attaching islands:
Attaching centroids:  100%
Topology was built.
Number of nodes     :   1
Number of primitives:   1
Number of points    :   1
Number of lines     :   0
Number of boundaries:   0
Number of centroids :   0
Number of areas     :   0
Number of isles     :   0

Which is quite as it should be. However, with this, the whole existence of the column-option is quite meaningless. The table produced is 

CREATE TABLE `LucioVero` (
  `cat` int(11) default NULL,
  `dbl_1` double default NULL,
  `dbl_2` double default NULL,
  `str_1` varchar(19) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1; 

Now what is wrong? I really don't need the dbl_1 and dbl_2 columns to hold the coordinates, and it would be nice if str_1 were Name and its length were 100 instead of 19. Also, the resulting vector does not have anything to show on the displays: d.vect LucioVero shows and empty map. v.out.ascii, however, produces the original coordinates, so I guess in this case, all the data goes only to the database and none of it is taken as coordinates.

There's definitively something wrong here. More information provided if needed.

Greetings,

Harri K.

-------------------------------------------- Managed by Request Tracker




More information about the grass-dev mailing list