[GRASS-dev] Re: [GRASS GIS] #1159: v.in.ascii fails with long text file in WinGRASS-6.4.0-1

GRASS GIS trac at osgeo.org
Wed Sep 15 04:31:56 EDT 2010


#1159: v.in.ascii fails with long text file in WinGRASS-6.4.0-1
------------------------+---------------------------------------------------
 Reporter:  lponti      |       Owner:  grass-dev@…              
     Type:  defect      |      Status:  new                      
 Priority:  normal      |   Milestone:  6.4.1                    
Component:  Vector      |     Version:  6.4.0                    
 Keywords:  v.in.ascii  |    Platform:  MSWindows 7              
      Cpu:  x86-32      |  
------------------------+---------------------------------------------------

Comment(by lponti):

 Replying to [comment:2 hamish]:
 > [...] I think it is good to explicitly give x= and y=..

 Right, I forgot that. For sake of completeness, it does not help in this
 case:

 {{{
 v.in.ascii input=Bloomday_Olive_11set10_Avg output=test_US_import fs=tab
 x=1 y=2 z=0
 Scanning input for column types...
 Maximum input row length: 31
 Maximum number of columns: 3
 Minimum number of columns: 3
 Column: 1  type: double
 Column: 2  type: double
 Column: 3  type: double
 Importando punti ...
 Populating table...
 ERROR: Could not close attribute table. The DBMI driver did not accept all
 attributes
 }}}

 Neither does specifying column type:

 {{{
 v.in.ascii input=Bloomday_Olive_11set10_Avg output=test_US_import fs=tab
 x=1 y=2 z=0 columns='x double, y double, value varchar(20)'
 Scanning input for column types...
 Maximum input row length: 31
 Maximum number of columns: 3
 Minimum number of columns: 3
 Column: 1  type: double
 Column: 2  type: double
 Column: 3  type: double
 Column number 3 <value> defined as string has double values
 Importando punti ...
 Populating table...
 ERROR: Could not close attribute table. The DBMI driver did not accept all
 attributes
 }}}

 Same with third column as double:

 {{{
 v.in.ascii input=Bloomday_Olive_11set10_Avg output=test_US_import fs=tab
 x=1 y=2 z=0 columns='x double, y double, value double'
 Scanning input for column types...
 Maximum input row length: 31
 Maximum number of columns: 3
 Minimum number of columns: 3
 Column: 1  type: double
 Column: 2  type: double
 Column: 3  type: double
 Importando punti ...
 Populating table...
 ERROR: Could not close attribute table. The DBMI driver did not accept all
 attributes
 }}}

 > does it work if you switch to the SQLite DB backend?

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

 db.connect -p
 driver:sqlite
 database:$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite.db
 schema:
 group:
 }}}

 This does not work:

 {{{
 v.in.ascii input=Bloomday_Olive_11set10_Avg output=test_US_import fs=tab
 x=1 y=2 z=0
 Scanning input for column types...
 Maximum input row length: 31
 Maximum number of columns: 3
 Minimum number of columns: 3
 Column: 1  type: double
 Column: 2  type: double
 Column: 3  type: double
 Importando punti ...
 Populating table...
 ERROR: Could not close attribute table. The DBMI driver did not accept all
 attributes
 }}}

 nor does this:

 {{{
 v.in.ascii input=Bloomday_Olive_11set10_Avg output=test_US_import fs=tab
 x=1 y=2 z=0 columns=x double, y double, value varchar(20)
 Scanning input for column types...
 Maximum input row length: 31
 Maximum number of columns: 3
 Minimum number of columns: 3
 Column: 1  type: double
 Column: 2  type: double
 Column: 3  type: double
 Column number 3 <value> defined as string has double values
 Importando punti ...
 Populating table...
 ERROR: Could not close attribute table. The DBMI driver did not accept all
 attributes
 }}}

 or this:

 {{{
 v.in.ascii input=Bloomday_Olive_11set10_Avg output=test_US_import fs=tab
 x=1 y=2 z=0 columns=x double, y double, value double
 Scanning input for column types...
 Maximum input row length: 31
 Maximum number of columns: 3
 Minimum number of columns: 3
 Column: 1  type: double
 Column: 2  type: double
 Column: 3  type: double
 Importando punti ...
 Populating table...
 ERROR: Could not close attribute table. The DBMI driver did not accept all
 attributes
 }}}

 Note: the --overwrite flag does not work because of Ticket #1158, so after
 each v.in.ascii one needs to run g.remove twice on output file.

 > what if you add "columns='x double, y double, value varchar(20)'" ?

 See above.

 > or "-z z=3" ? (but no columns= to avoid creating a table at all)

 This works in sqlite (but no table, as you said):

 {{{
 v.in.ascii input=Bloomday_Olive_11set10_Avg output=test_US_import fs=tab
 x=1 y=2 -z z=3
 Scanning input for column types...
 Maximum input row length: 31
 Maximum number of columns: 3
 Minimum number of columns: 3
 Importando punti ...
 Building topology for vector map <test_US_import>...
 Registering primitives...
    10001157 primitives registered
 1157 vertices registered
 Building areas...
 0 areas built
 0 isles built
 Attaching islands...
 Attaching centroids...
 Number of nodes: 1156
 Number of primitives: 1157
 Number of points: 1157
 Number of lines: 0
 Number of boundaries: 0
 Number of centroids: 0
 Number of areas: 0
 Number of isles: 0
 v.in.ascii completo.
 (Wed Sep 15 10:19:46 2010) Command finished (0 sec)
 }}}

 and with dbf (surprisingly the --overwrite flag works):

 {{{
 v.in.ascii --overwrite input=Bloomday_Olive_11set10_Avg
 output=test_US_import fs=tab x=1 y=2 -z z=3
 Vector map <test_US_import> already exists and will be overwritten
 Scanning input for column types...
 Maximum input row length: 31
 Maximum number of columns: 3
 Minimum number of columns: 3
 Importando punti ...
 Building topology for vector map <test_US_import>...
 Registering primitives...
    10001157 primitives registered
 1157 vertices registered
 Building areas...
 0 areas built
 0 isles built
 Attaching islands...
 Attaching centroids...
 Number of nodes: 1156
 Number of primitives: 1157
 Number of points: 1157
 Number of lines: 0
 Number of boundaries: 0
 Number of centroids: 0
 Number of areas: 0
 Number of isles: 0
 v.in.ascii completo.
 }}}

 Sounds like the table is the problem?

 Regards,

 Luigi

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/1159#comment:3>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list